You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by carmi_cd <ca...@yahoo.com> on 2008/01/04 10:44:28 UTC

[S2] how to get the value of form select

i have a form select..my problem is how to i get the selected values of the
form select..
what is its data type..is it ArrayList?

here is my code..

                <s:select name="selectedModules"
value="%{edituser.modules.{moduleId}}"
                                                  list="modules"
listKey="moduleId" listValue="moduleName" 
                                                  multiple="true" size="7" 
/>


thanks in advance for your help
-- 
View this message in context: http://www.nabble.com/-S2--how-to-get-the-value-of-form-select-tp14613273p14613273.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] how to get the value of form select

Posted by carmi_cd <ca...@yahoo.com>.
how should i get its value..i'm really new to this please help me..

should it be this way..

List selectedmod = getSelectedModules();

System.out.print("Selected " +selectedmod.get(0));

thanks again


xniit2003 wrote:
> 
> It should be a list.
> I guess your "selectedModules" in the name attribute is also a list and
> the
> values of selected items will be
> populated into it. If you wouldn't write multiple=true, the return data
> type
> would be String.
> 
> On Jan 4, 2008 3:14 PM, carmi_cd <ca...@yahoo.com> wrote:
> 
>>
>> i have a form select..my problem is how to i get the selected values of
>> the
>> form select..
>> what is its data type..is it ArrayList?
>>
>> here is my code..
>>
>>                <s:select name="selectedModules"
>> value="%{edituser.modules.{moduleId}}"
>>                                                  list="modules"
>> listKey="moduleId" listValue="moduleName"
>>                                                  multiple="true" size="7"
>> />
>>
>>
>> thanks in advance for your help
>> --
>> View this message in context:
>> http://www.nabble.com/-S2--how-to-get-the-value-of-form-select-tp14613273p14613273.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 
> -- 
> Thanks & Regards
>  Arpan Debroy
> 
> AOL Online India Private Ltd
> RMZ EcoSpace Campus 1A
> Outer Ring Road, Bellandur,
> Bangalore - 560037
> India
> Mobile No :+9886006306
> on-board :+91 (80) 4035 4528
> E-mail : arpan.debroy@corp.aol.com
> 
> 

-- 
View this message in context: http://www.nabble.com/-S2--how-to-get-the-value-of-form-select-tp14613273p14657904.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] how to get the value of form select

Posted by Arpan Debroy <ar...@gmail.com>.
It should be a list.
I guess your "selectedModules" in the name attribute is also a list and the
values of selected items will be
populated into it. If you wouldn't write multiple=true, the return data type
would be String.

On Jan 4, 2008 3:14 PM, carmi_cd <ca...@yahoo.com> wrote:

>
> i have a form select..my problem is how to i get the selected values of
> the
> form select..
> what is its data type..is it ArrayList?
>
> here is my code..
>
>                <s:select name="selectedModules"
> value="%{edituser.modules.{moduleId}}"
>                                                  list="modules"
> listKey="moduleId" listValue="moduleName"
>                                                  multiple="true" size="7"
> />
>
>
> thanks in advance for your help
> --
> View this message in context:
> http://www.nabble.com/-S2--how-to-get-the-value-of-form-select-tp14613273p14613273.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Thanks & Regards
 Arpan Debroy

AOL Online India Private Ltd
RMZ EcoSpace Campus 1A
Outer Ring Road, Bellandur,
Bangalore - 560037
India
Mobile No :+9886006306
on-board :+91 (80) 4035 4528
E-mail : arpan.debroy@corp.aol.com