aspose file tools*
The moose likes JSF and the fly likes How to access the current row index in dataTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "How to access the current row index in dataTable" Watch "How to access the current row index in dataTable" New topic
Author

How to access the current row index in dataTable

Robin Sharma
Ranch Hand

Joined: Aug 24, 2005
Posts: 76
Hi!

Is there a straightforward way to access the current row index while rendering a standard JSF dataTable component? I want to show the serial number for each row.

Is creating a binding to a bean the only way to do that?

Thanks.


DW
There is always a bug :-)
Jamie Williams
Ranch Hand

Joined: Mar 31, 2006
Posts: 70
Hi Robin, I had the same problem. If you use a Tomahawk dataTable you can the variable 'rowIndexVar' to get the row number, starting at zero. Here is how I print out my row numbers:



Hope this helps!
Rahul Juneja
Ranch Hand

Joined: Aug 03, 2002
Posts: 425
What if i am using JSR-RI implementation with Icefaces.


Rahul Juneja
ThoughtClicks - http://techlabs.thoughtclicks.com
Steffen Neustadt
Greenhorn

Joined: Sep 30, 2008
Posts: 11
what about the getRowIndex()-methode of your dataModel?
Saeed alkhen
Greenhorn

Joined: Feb 11, 2009
Posts: 4
Hi,
Try this :


and then
 
wood burning stoves
 
subject: How to access the current row index in dataTable