• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

html:select

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
How to use html:select tag to populate a drop down database ....for ex a drop down of all the US states from database.
If anyone can provide a code it will be great
Thanks
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See this sample code .

<html:select property="contentID" size="5" style="width:200px;" >
<html ptions collection="SearchResult" property="contentID" labelProperty="contentDesc"/>
</html:select>
here property = contentID maps to your attribute in the form bean.
The options collection "SearchResult" in my request/session and its an ArrayList of an Objects which has contentID and contentDesc as attributes/properties. Hope this is clear.
 
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic