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=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> 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=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user