struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Lee <jjmli_str...@yahoo.com>
Subject RE: Does anybody know how to PRE-select MULTIPLE options with the selct tag?<EOM>
Date Thu, 15 Aug 2002 19:08:43 GMT

Thanks Sri. I have a custom select tag used in several places and I would like to pass in
dynamic values to be highlighted, just like you pass in a single value with the value attribute.
Of course I could always customize my select tag at run time to preselect multiple options.
Jim
 Sri Sankaran wrote: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:


Multiple Select Allowed:








Multiple Select From A Collection:







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:jjmli_struts@yahoo.com] 
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?



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: 



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:jjmli_struts@yahoo.com] 
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: 
For additional commands, e-mail: 



---------------------------------
Do You Yahoo!?
HotJobs, a Yahoo! service - Search Thousands of New Jobs
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message