• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

individual choice in combobox with struts

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Guys..
i have a problem here..
i have a vector where i put into all my choices for the combobox...
---
Collection repGroups= new Vector();
while(transManager.fetch(repGroup)){
repGroups.add(new LabelValueBean(repGroup.getGnam()+"-"+repGroup.getCpt(),""));
}
---
then i create the combobox as seen below...
---
<html:select property="rgid" >
<html ptions collection="repGroups" property="value" labelProperty="label"/>
</html:select>
---
now i want an alternative for the "selected" tag in the "<option...>" how it was done with the normal html code..
i would like to know how i can set the combobox to a individual choice when using struts..
something with the properties?
anyone has an idea?
Thanks in advance for valuable answers..
i count on you..
Daniel..
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In your case, you need to set the rgid property in your ActionForm to the value that you want initially selected. The struts tag will automatically add "selected" in the generated HTML when the rgid value matches an option value.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic