Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to do a Pre-selected drop down in Struts

 
kay lin
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the form bean with the stateOrProvince has the this value already set, Struts will select the correct value.
 
Kinjal Sonpal
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic