It is possible. Have a method on your ActionForm which returns a 
java.util.Collection of org.apache.struts.util.LabelValueBean's and use it 
using <html:optionsCollection/> in the jsp

For eg: 

public Collection getMyLVBList() {
Collection options = new ArrayList();
options.add(new LabelValueBean(label, value));
// add more options
return options;
}

<html:select property="selectProperty">
<html:optionsCollection property="myLVBList"/>
</html:select>

On 9/14/05, Dylan Stamat <[EMAIL PROTECTED]> wrote:
> 
> I'm using a LabelValueBean, as I need to have a "name" be diplayed, and a
> "value" be reported back to the form.
> 
> I have no problems creating a List of LabelValueBean's, setting them into
> the request like so:
> request.setAttribute("myLVBList", myLVBList);
> 
> ... and outputting them on the .jsp like so:
> <html:options collection="myLVBList" property="value"
> labelProperty="label"/>
> 
> However, I'd rather put this list into my Form, and not in the Request.
> I fiddled around with html:options and html:optionsCollection trying a 
> slew
> of different combinations using the Struts HTML docs as a reference, but 
> no
> luck.
> 
> Is this even possible ?
> 
> Thanks !
> ==
> Dylan
> 
>

Reply via email to