There are other optiosn to use it...
I ahve never used it with Arays but i have used it with Collections...

First i use jsp:useBean tag to get the collection from the form and make it available 
in the page scope and then use html:options with collection="beanName"

where beanName is the eban created through useBean tag..There must eb some way to use 
it with arrays...

Let me know if u dont find anything..May be tomorrow i will find some time to look at 
the doc..
regards,
Shirish

-----Original Message-----
From: Abhinav (Cognizant) [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 5:44 PM
To: Struts Users Mailing List
Subject: RE: html:options


correct me if I am wrong. 
This would work if getOptionList() returns an array of String.
In my case array is of Objects and one attribute of that object has to be displayed.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 9:07 PM
To: [EMAIL PROTECTED]
Subject: RE: html:options


check the documentation for the tag...

use name="formBeanName" property="optionList"

-----Original Message-----
From: Abhinav (Cognizant) [mailto:[EMAIL PROTECTED]
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:[EMAIL PROTECTED]
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: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to