You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bhaarat Sharma <bh...@gmail.com> on 2009/06/21 04:17:55 UTC
confusion about s:select with multiple true
I have been playing around with this sample code:
<s:select label="Months"
name="months"
headerKey="-1" headerValue="Select Month"
list="#{'01':'Jan', '02':'Feb'}"
value="#{'01','02'}"
multiple="true"
required="true"/>
This works as I want it to. My question is, if I want values for 'list' and
'value' coming from the action class then should the method for list be
returning a hashMap? and value be returning a list? is that the only way?
Re: confusion about s:select with multiple true
Posted by Dave Newton <ne...@yahoo.com>.
Bhaarat Sharma wrote:
> I have been playing around with this sample code:
>
> <s:select label="Months"
> name="months"
> headerKey="-1" headerValue="Select Month"
> list="#{'01':'Jan', '02':'Feb'}"
> value="#{'01','02'}"
> multiple="true"
> required="true"/>
>
> This works as I want it to. My question is, if I want values for 'list' and
> 'value' coming from the action class then should the method for list be
> returning a hashMap? and value be returning a list? is that the only way?
Did you try using a list for the "list" attribute? Or check out the docs
regarding the "list", "listKey", and "listValue" attributes?
http://struts.apache.org/2.1.6/docs/select.html
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org