check the documentation for the tag...
use name="formBeanName" property="optionList"
-----Original Message-----
From: Abhinav (Cognizant) [mailto:Abhinav@cal.cognizant.com]
Sent: Tuesday, May 27, 2003 5:38 PM
To: Struts Users Mailing List
Subject: RE: html:options
Yea...with collection it works. But what if my collection of objects is obtained from the
form-bean.
(I dont want to use scripting to first take the collection out of the form-bean.)
-----Original Message-----
From: Gareth Andrew [mailto:gareth.andrew@ntlworld.com]
Sent: Tuesday, May 27, 2003 9:00 PM
To: Struts Users Mailing List
Subject: Re: html:options
In one of my JSPs I have:
<html:select property="publishCountry" size="1">
<html:options collection="locales"
property="ISOCode" labelProperty="displayName"/>
</html:select>
where locales is an array of beans with getISOCode() and
getDisplayName() methods.
Hope this helps,
Gareth
Abhinav (Cognizant) wrote:
>I have one form bean with getter/setters for property List.
>getter returns a vector of objects of type { getID(), getDesc(), setID(), setDesc() }
>
>I have to use this vector to populate a select box in html using html:select/options
>somehow i am unable to make out labelProperty, labelName
>
>Can someone gimme an example how this can be done.
>
>
>
>
>
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
|