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 how to do a Pre-selected drop down in Struts 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 "how to do a Pre-selected drop down in Struts" Watch "how to do a Pre-selected drop down in Struts" New topic
Author

how to do a Pre-selected drop down in Struts

kay lin
Ranch Hand

Joined: May 20, 2004
Posts: 132
Hi All:
Just a quick question, would any body happen to know how to do a pre-selected drop down box in struts?

for example,


and I would like to have one of the values in the "PROVINCES_STATES" collection to show up as selected, how do i do that, please let me know

Many Thanks
Charles Hasegawa
Ranch Hand

Joined: May 22, 2003
Posts: 117
If the form bean with the stateOrProvince has the this value already set, Struts will select the correct value.
Kinjal Sonpal
Ranch Hand

Joined: Jun 06, 2003
Posts: 96
Originally posted by dog lin:
Just a quick question, would any body happen to know how to do a pre-selected drop down box in struts?
Set value for the select property of the form-bean before the page is called, a fronting action is probably the best bet.

HTH.

Kinjal
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to do a Pre-selected drop down in Struts
 
Similar Threads
dynamic value to be submitted to form beans
enable/disable drop down
Dynamic Population of Drop Down List using AJAX
Param passing in link, prepopulation and javascript
On htm:multibox