This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

html:select

 
Rajeev Bakhru
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • 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
 
Radhika Jaju
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic