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

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: 17665
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.
 
To do a great right, do a little wrong - shakepeare. twisted little ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic