Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Iterating multiple dropdowns in struts

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a JSP which has five dropdowns which is repeated 10 times (10 rows) for simultaneous update.I have populated the dropdown values from array of each column using html:select and html:options as :

Similarly for other 4 columns.The arrays are populated in action class as shown in below code:

Similarly for other 4 columns.In Form bean i have 5 arrays for 5 columns and its getter & setter methods.Now,I want to recieve the values selected by user in a List which will have ten objects added for each rows.I have a classs which have 5 variables for each column and its list is in form bean class which will get the values of each 10 rows.I tried to use logic:iterate but it is displaying error that logic:iterate can't be used with select and options.
Can anyone suggest solution for this problem.

Thanks in advance.
Regards,
Anil
 
Anil dhingra
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone suggest some solution Please?

Thanks,
Anil
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
google for "<html:optionCollections property=""/> [LabelValueBean] "
 
Anil dhingra
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I tried to search a lot about this problem but I have not got anything significant.The main problem is how to associate the values of all the dropdowns and get it into list for all the ten rows.Has anyone worked on this kind of issue earlier?Please help if you have any idea on this.

Thanks,
Anil
 
Let's go to the waterfront with this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic