Win a copy of Event Streams in Action this week in the Java in General 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
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Populating each row of a Column with combo boxes containing values from database

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can any one let me know the code of how to populate each row of a column with combo boxes containing the values from the database.I am using a Struts framework .

Regards,
Sachin Paradkar.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is how I do it with JSTL:



Where pcmodel is an ArrayList that I placed in the request like:



If you need different values for the "value" and "name" of the <option> tag then you can use a Map and use bla.key and bla.value accordingly.

If you want to use Struts tags to do this (it's a bit easier with Struts custom select tag) then I'll move this to that forum and those Struts guys can help you out over there. Let me know...
 
Marshal
Posts: 67273
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I'm going to go ahead and move it now since if he is using Struts tags for everything else, it'd be best to continue.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!