Jim:
I have struts 1.0.2. The jsp in that version shows two examples of multiple
selections has the following code segment
String multipleValues[] =
{ "Multiple 0", "Multiple 1", "Multiple 2", "Multiple 3", "Multiple 4",
"Multiple 5", "Multiple 6", "Multiple 7", "Multiple 8", "Multiple 9" };
pageContext.setAttribute("multipleValues", multipleValues);
Vector options = new Vector();
options.add(new OptionBean("Label 0", "Value 0"));
options.add(new OptionBean("Label 1", "Value 1"));
// lines commented for brevity
pageContext.setAttribute("options", options);
Further down it has:
<tr>
<th align="right">Multiple Select Allowed:</th>
<td align="left">
<html:select property="multipleSelect" size="10" multiple="true">
<html:options name="multipleValues" labelName="multipleValues"/>
</html:select>
</td>
</tr>
<tr>
<th align="right">Multiple Select From A Collection:</th>
<td align="left">
<html:select property="collectionSelect" size="10" multiple="true">
<html:options collection="options" property="value" labelProperty="label"/>
</html:select>
</td>
</tr>
The form bean for this page (TestBean) has the necessary collections 'multipleSelect'
and 'collectionSelect' for the two examples. Pre-selection is driven by the values in
these collections.
Hope that helped
Sri
-----Original Message-----
From: Jim Lee [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 15, 2002 10:07 AM
To: Struts Users Mailing List
Subject: RE: Does anybody know how to PRE-select MULTIPLE options with the selct
tag?<EOM>
Hi Sri,
I read the html-select.jsp example but failed to find one that shows how to preselect
multiple options from a multiselect tag. Could you give a line of example please? What
I would like is something like:
<html:select property="selected" values="value1,value2">
<html:options .../>
</html:select>
Thanks,
Jim
Sri Sankaran wrote:See sample app that ships with Struts.
struts-exercise-taglib/html-select.jsp
Sri
-----Original Message-----
From: Jim Lee [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 14, 2002 4:31 PM
To: Struts Users Mailing List
Subject: Does anybody know how to PRE-select MULTIPLE options with the selct tag?
---------------------------------
Do You Yahoo!?
HotJobs, a Yahoo! service - Search Thousands of New Jobs
--
To unsubscribe, e-mail:
For additional commands, e-mail:
---------------------------------
Do You Yahoo!?
HotJobs, a Yahoo! service - Search Thousands of New Jobs
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>