You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Wang <dw...@hotmail.com> on 2013/08/06 08:06:42 UTC
sj:select value problem
Hello,
As a beginner in struts field, I send this question to see if I get any help. Here it is. I have a multiple dropdown menu. What I want to do is to pre-select related items based the value passed in. Specifically, I have
html:<select name="echo" multiple="multiple" id="pattern0" class="multiselect"> <option value="-1">Select keywords</option> <option></option> <option value="1 Cool">1 Cool</option> <option value="1 Heat">1 Heat</option> <option value="3 Heat">3 Heat</option> <option value="1 Heat/1 Cool">1 Heat/1 Cool</option></select>
jsp: <sj:select href="%{remoteurl_pattern02}" id="selectWithReloadTopic_pattern02" formIds="formSelectReload" reloadTopics="reloadsecondlist_pattern02" name="echo_pattern02" list="reloadList_pattern02" multiple="true" selectable="true" cssClass="multiselect" dataType="json" emptyOption="true" headerKey="-1" headerValue="Select keywords" resizableMinHeight="15" resizableMaxHeight="20" value="%{patternKeyword2}" />
and I pass in an array to "value". The array has [1 Cool, 1 Heat, 1 Heat/1 Cool]. The array's name is "patternKeyword2". When I ran the code, I found that these three items [1 Cool, 1 Heat, 1 Heat/1 Cool] were not selected in the dropdown menu.
Anybody knows how to fix this?
Thanks so much.
David
RE: sj:select value problem
Posted by David Wang <dw...@hotmail.com>.
Thanks Lukasz,
David
> From: lukaszlenart@apache.org
> Date: Wed, 7 Aug 2013 12:01:23 +0200
> Subject: Re: sj:select value problem
> To: user@struts.apache.org
>
> 2013/8/7 David Wang <dw...@hotmail.com>:
> > value="%{patternKeyword2}" />
>
> I don't know if this supports anything else than just a String. Please
> ask question on the user group or directly under the wiki page
>
> https://groups.google.com/forum/#!forum/struts2-jquery
> https://code.google.com/p/struts2-jquery/wiki/SelectTag
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
Re: sj:select value problem
Posted by Lukasz Lenart <lu...@apache.org>.
2013/8/7 David Wang <dw...@hotmail.com>:
> value="%{patternKeyword2}" />
I don't know if this supports anything else than just a String. Please
ask question on the user group or directly under the wiki page
https://groups.google.com/forum/#!forum/struts2-jquery
https://code.google.com/p/struts2-jquery/wiki/SelectTag
Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: sj:select value problem
Posted by David Wang <dw...@hotmail.com>.
Hi Lukasz,
Thanks a lot for your reply. I use Struts 2 Jquery Plugin. Here is formatted code.
html:
<select name="echo" multiple="multiple" id="pattern0"
class="multiselect">
<option value="-1">Select
keywords</option> <option></option>
<option value="1 Cool">1 Cool</option>
<option value="1
Heat">1 Heat</option>
<option value="3 Heat">3
Heat</option>
<option value="1 Heat/1 Cool">1 Heat/1
Cool</option>
</select>
jsp:
<sj:select
href="%{remoteurl_pattern02}"
id="selectWithReloadTopic_pattern02"
formIds="formSelectReload"
reloadTopics="reloadsecondlist_pattern02"
name="echo_pattern02"
list="reloadList_pattern02"
multiple="true"
selectable="true"
cssClass="multiselect"
dataType="json"
emptyOption="true"
headerKey="-1"
headerValue="Select keywords"
resizableMinHeight="15"
resizableMaxHeight="20"
value="%{patternKeyword2}" />
I pass in an array to "value". The array has [1 Cool, 1 Heat, 1 Heat/1
Cool]. The array's name is "patternKeyword2". When I ran the code, I
found that these three items [1 Cool, 1 Heat, 1 Heat/1 Cool] were not
selected in the dropdown menu.
Any ideas?
Thanks so much.
> From: lukaszlenart@apache.org
> Date: Tue, 6 Aug 2013 08:29:21 +0200
> Subject: Re: sj:select value problem
> To: user@struts.apache.org
>
> 2013/8/6 David Wang <dw...@hotmail.com>:
> > Hello,
> > As a beginner in struts field, I send this question to see if I get any help. Here it is. I have a multiple dropdown menu. What I want to do is to pre-select related items based the value passed in. Specifically, I have
> > html:<select name="echo" multiple="multiple" id="pattern0" class="multiselect"> <option value="-1">Select keywords</option> <option></option> <option value="1 Cool">1 Cool</option> <option value="1 Heat">1 Heat</option> <option value="3 Heat">3 Heat</option> <option value="1 Heat/1 Cool">1 Heat/1 Cool</option></select>
> > jsp: <sj:select href="%{remoteurl_pattern02}" id="selectWithReloadTopic_pattern02" formIds="formSelectReload" reloadTopics="reloadsecondlist_pattern02" name="echo_pattern02" list="reloadList_pattern02" multiple="true" selectable="true" cssClass="multiselect" dataType="json" emptyOption="true" headerKey="-1" headerValue="Select keywords" resizableMinHeight="15" resizableMaxHeight="20" value="%{patternKeyword2}" />
> > and I pass in an array to "value". The array has [1 Cool, 1 Heat, 1 Heat/1 Cool]. The array's name is "patternKeyword2". When I ran the code, I found that these three items [1 Cool, 1 Heat, 1 Heat/1 Cool] were not selected in the dropdown menu.
> > Anybody knows how to fix this?
>
> Do you the Struts 2 jQuery plugin? And some better formatting please :-)
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
Re: sj:select value problem
Posted by Lukasz Lenart <lu...@apache.org>.
2013/8/6 David Wang <dw...@hotmail.com>:
> Hello,
> As a beginner in struts field, I send this question to see if I get any help. Here it is. I have a multiple dropdown menu. What I want to do is to pre-select related items based the value passed in. Specifically, I have
> html:<select name="echo" multiple="multiple" id="pattern0" class="multiselect"> <option value="-1">Select keywords</option> <option></option> <option value="1 Cool">1 Cool</option> <option value="1 Heat">1 Heat</option> <option value="3 Heat">3 Heat</option> <option value="1 Heat/1 Cool">1 Heat/1 Cool</option></select>
> jsp: <sj:select href="%{remoteurl_pattern02}" id="selectWithReloadTopic_pattern02" formIds="formSelectReload" reloadTopics="reloadsecondlist_pattern02" name="echo_pattern02" list="reloadList_pattern02" multiple="true" selectable="true" cssClass="multiselect" dataType="json" emptyOption="true" headerKey="-1" headerValue="Select keywords" resizableMinHeight="15" resizableMaxHeight="20" value="%{patternKeyword2}" />
> and I pass in an array to "value". The array has [1 Cool, 1 Heat, 1 Heat/1 Cool]. The array's name is "patternKeyword2". When I ran the code, I found that these three items [1 Cool, 1 Heat, 1 Heat/1 Cool] were not selected in the dropdown menu.
> Anybody knows how to fix this?
Do you the Struts 2 jQuery plugin? And some better formatting please :-)
Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org