This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes struts2 - Iterator List increment on page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts2 - Iterator List increment on page" Watch "struts2 - Iterator List increment on page" New topic
Author

struts2 - Iterator List increment on page

Santhosh Kalisamy
Ranch Hand

Joined: Apr 15, 2008
Posts: 56
Friends,

I do have a problem.

I do need to display a select box and a textfield. Once user selected a value on select box 1 and text field 1, I have to display Selec Box 2 and Text field 2.

I have to go up to 5 like that.

Right now, I am displaying all 5 on page load using Struts Iterator.



Please share some ideas.... Thanks in advance.
nir sharma
Ranch Hand

Joined: Sep 11, 2012
Posts: 72

you can use javascript to show only one pair and hide rest of the four, and then on blur from that pair you can check whether its filled or not and accordingly show the next pair and continue with the same cycle.
second you can use ajax, and dynamically populate pairs once previous pair is filled.
Santhosh Kalisamy
Ranch Hand

Joined: Apr 15, 2008
Posts: 56
Thanks N. Sharma.

Can I have the AJAX sample code please?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: struts2 - Iterator List increment on page
 
Similar Threads
Struts 2 forms and collections
Data mismatch between two separate lists in a single iterator in struts2
Tag that display a list in Struts 2
Struts2: Retern all the values inside the list in my Action
spaces while populating using s:iterator