File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes selecting a row in s:iterator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "selecting a row in s:iterator " Watch "selecting a row in s:iterator " New topic
Author

selecting a row in s:iterator

Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
I am iterating rows for setting values in row elements...




In the UI after displaying these values I need to select any of the produced rows... In the above the rowid would be same for each row!

How to achieve it? This could have been in JS forum but usage of struts prompted me to be here ...
Tom Rispoli
Ranch Hand

Joined: Aug 29, 2008
Posts: 349
When I've had to do this I used the status attribute in the iterator tag to give me a variable that holds the index that that iterator is at, then I append the value of that variable to the id for the row, so in your case, something like this:



Hope that answers your question.
Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
If we need to write this whole thing in Javascript can we achieve that?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Achieve what? The original response provides the usual mechanism for identifying HTML elements.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: selecting a row in s:iterator