[Wicket-user] Why item.getIndex() always zero?

2006-09-14 Thread wq

..
int c = 0; 
..
List columns = new ArrayList();
columns.add(new AbstractColumn(new Model(操作)){
public void populateItem(Item cellItem, String 
componentId, IModel
model){
c += cellItem.getIndex()+ 1;

System.out.println(cellItem.getIndex():+cellItem.getIndex());
System.out.println(c:+c);
cellItem.add(new ActionPanel(componentId, 
model));
}
});
..
add(new DefaultDataTable(table, columns, new ColumnDataProvider(),50));
..


the Class ColumnDataProvider extends SortableDataProvider.

cellItem.getIndex() always return 0.why?


-- 
View this message in context: 
http://www.nabble.com/Why-item.getIndex%28%29-always-zero--tf2270996.html#a6303776
Sent from the Wicket - User forum at Nabble.com.


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Why item.getIndex() always zero?

2006-09-14 Thread Martijn Dashorst
Because the cellItems are the column items...

You only have one column, so it will always return 0 (first column).

Martijn

On 9/14/06, wq [EMAIL PROTECTED] wrote:

 ..
 int c = 0;
 ..
 List columns = new ArrayList();
 columns.add(new AbstractColumn(new Model(操作)){
 public void populateItem(Item cellItem, String 
 componentId, IModel
 model){
 c += cellItem.getIndex()+ 1;
 
 System.out.println(cellItem.getIndex():+cellItem.getIndex());
 System.out.println(c:+c);
 cellItem.add(new ActionPanel(componentId, 
 model));
 }
 });
 ..
 add(new DefaultDataTable(table, columns, new ColumnDataProvider(),50));
 ..


 the Class ColumnDataProvider extends SortableDataProvider.

 cellItem.getIndex() always return 0.why?


 --
 View this message in context: 
 http://www.nabble.com/Why-item.getIndex%28%29-always-zero--tf2270996.html#a6303776
 Sent from the Wicket - User forum at Nabble.com.


 -
 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



-- 
Download Wicket 1.2.2 now! New Ajax components: Tree, TreeTable and ModalWindow
-- http://wicketframework.org

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Why item.getIndex() always zero?

2006-09-14 Thread wq

List columns = new ArrayList();
columns.add(new AbstractColumn(new Model(操作)){
public void populateItem(Item cellItem, String 
componentId, IModel
model){
rowIndex += cellItem.getIndex()+ 1;

//System.out.println(cellItem.getIndex():+cellItem.getIndex());
//System.out.println(c:+c);
cellItem.add(new ActionPanel(componentId, 
model));
}
});
columns.add(new PropertyColumn(new Model(ID), id));
columns.add(new AbstractColumn(new Model(display)) {
public void populateItem(Item cellItem, String 
componentId, IModel
rowModel) {
cellItem.add(new 
TitlePanel(componentId,rowModel));
}

});
columns.add(new PropertyColumn(new Model(type), 
strClmType));
columns.add(new PropertyColumn(new Model(control), 
activeDate));

...
I could misUnderstand your means but there are many columns  and many
ActionPanel.




Martijn Dashorst-4 wrote:
 
 Because the cellItems are the column items...
 
 You only have one column, so it will always return 0 (first column).
 
 Martijn
 
 On 9/14/06, wq [EMAIL PROTECTED] wrote:

 ..
 int c = 0;
 ..
 List columns = new ArrayList();
 columns.add(new AbstractColumn(new Model(操作)){
 public void populateItem(Item cellItem, String
 componentId, IModel
 model){
 c += cellItem.getIndex()+ 1;

 System.out.println(cellItem.getIndex():+cellItem.getIndex());
 System.out.println(c:+c);
 cellItem.add(new ActionPanel(componentId,
 model));
 }
 });
 ..
 add(new DefaultDataTable(table, columns, new ColumnDataProvider(),50));
 ..


 the Class ColumnDataProvider extends SortableDataProvider.

 cellItem.getIndex() always return 0.why?


 --
 View this message in context:
 http://www.nabble.com/Why-item.getIndex%28%29-always-zero--tf2270996.html#a6303776
 Sent from the Wicket - User forum at Nabble.com.


 -
 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job
 easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache
 Geronimo
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

 
 
 -- 
 Download Wicket 1.2.2 now! New Ajax components: Tree, TreeTable and
 ModalWindow
 -- http://wicketframework.org
 
 -
 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job
 easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

-- 
View this message in context: 
http://www.nabble.com/Why-item.getIndex%28%29-always-zero--tf2270996.html#a6304285
Sent from the Wicket - User forum at Nabble.com.


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user