File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes individual choice in combobox with struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "individual choice in combobox with struts" Watch "individual choice in combobox with struts" New topic
Author

individual choice in combobox with struts

Dan Pan
Greenhorn

Joined: Apr 30, 2003
Posts: 1
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
Bartender

Joined: Feb 26, 2001
Posts: 4446
    
    5

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.


Junilu - [How to Ask Questions] [How to Answer Questions]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: individual choice in combobox with struts
 
Similar Threads
Combobox Problem
Struts - View html:select
show different content after a choice in a combobox
struts - logic:iterator used with html:select
Struts - Using Nested Beans