• Post Reply Bookmark Topic Watch Topic
  • New Topic

individual choice in combobox with struts  RSS feed

 
Dan Pan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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..
 
Junilu Lacar
Sheriff
Posts: 10878
158
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • 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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!