File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes getting table row number when link is clicked question 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 "getting table row number when link is clicked question" Watch "getting table row number when link is clicked question" New topic
Author

getting table row number when link is clicked question

Dan MacLeod
Ranch Hand

Joined: Mar 19, 2009
Posts: 30
I have a dataTableEx that contains a commandLink in one of it's columns. When the link is clicked and the backend action is invoked, how do I get the row number the selected link is in?

thanks
Dan
Dawn Charangat
Ranch Hand

Joined: Apr 26, 2007
Posts: 249
That has to be done at the time of table rendering.

Assuming that you would be dynamically creating your tables [either using javascript or any serverside scripting]. You'll have to assign a unique ID to your row, either with a sequence, or with the unique item in the object being populated in its row. Once the item with hyperlink is written to the table, you will have to add the item ID as a parameter in its URL [in the hyperlink]. That would help you identify which row's link was clicked.

Dawn.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getting table row number when link is clicked question