Make the property of your <html:select> a collection with the appropriate getter and 
setter.  All this is covered in the struts-exercise-taglib app that comes with the 
Struts distribution.

Sri
P.S. selectedItem just the name of is a form bean property.  

-----Original Message-----
From: Rodger Cooley [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 12:29 PM
To: Struts Users Mailing List
Subject: RE: Having a preselected option in dropdown. Multiple default
selections?



Is it possible for multiple default selections?
BTW, I didn't see the selectedItem in the struts 1.1 html tld... where'd you
find it?



-----Original Message-----
From: Sri Sankaran [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 12:24 PM
To: 'Struts Users Mailing List'
Subject: RE: Having a preselected option in dropdown.


Of course your 'optionValues' collection must have an item called 'Item 2'.

BTW: The form bean 'selectedItem' value should read 'Item 2'.

Sri

-----Original Message-----
From: Sri Sankaran
Sent: Wednesday, May 29, 2002 1:19 PM
To: 'Struts Users Mailing List'
Subject: RE: Having a preselected option in dropdown.


-- JSP Code --

<html:select property="selectedItem" size="10">
        <html:options name="optionValues" labelName="optionValues"/>
</html:select>

-- Form Bean --

String selectedItem = "Single 2";


This will result in a drop-down with 'Item 2' selected.

Hope that helps

Sri

-----Original Message-----
From: Harjeet Singh [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 12:07 PM
To: [EMAIL PROTECTED]
Subject: Having a preselected option in dropdown.


How can I define a pre-selcetd option for the dropdown. I know there should
be a way for it, but try as I migth I am not able to find how.

Could someone provide me a sample peice of code for same.

Thanks in advance.


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

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

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





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

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

Reply via email to