This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell 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


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
 
GeeCON Prague 2014
 
subject: how to do a Pre-selected drop down in Struts