I was able to do it like that.     

<bean:define id="blist" name="MyForm" property="List" type="java.util.Vector"/>
        <html:select property="Id">
                <html:options collection="list" property="ID" labelProperty="desc" />
        </html:select>  

Thanks a lot all you ppl.


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


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]



****** Message from InterScan E-Mail VirusWall NT ******

** No virus found in attached file noname.htm

No Virus detected in the attached file(s).
*****************     End of message     ***************


This e-mail and any files transmitted with it are for the sole use of the intended 
recipient(s) and may contain confidential and privileged information. If you are not 
the 
intended recipient, please contact the sender by reply e-mail and destroy all copies 
of 
the original message. 
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or 
copying 
of this email or any action taken in reliance on this e-mail is strictly prohibited 
and 
may be unlawful.

          Visit us at http://www.cognizant.com

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

Reply via email to