You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jim Kiley <jh...@summa-tech.com> on 2009/06/24 18:03:52 UTC
Re: Generating Dynamic radio button list
You need to provide Struts with an actual List (or Set or the like). It
looks like you are providing a single String. You will need to parse that
String out into a List of Strings in order for <s:radio> to treat it as a
List.
jk
2009/6/24 BlackKnight <ww...@gmail.com>
> Hi,
>
> I am trying to generate a dynamic raido buttom list using
>
> <s:radio name="%{optionname}" list="%{optionvalue}" />
>
> where optionvalue is stored in database equal
>
> #{'Faculty':'Faculty<BR>','Staff':'Staff<BR>','Resident':'Resident<BR>','Intern':'Intern<BR>'}
>
> however struts2 doesn't generate the radio button list intead he
> generate only 1 radio button with value equals
>
> #{'Faculty':'Faculty<BR>','Staff':'Staff<BR>','Resident':'Resident<BR>','Intern':'Intern<BR>'}
>
> Any help?
>
>
> Thanks!
>
>
> Frank
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
Jim Kiley
Senior Technical Consultant | Summa
[p] 412.258.3346
http://www.summa-tech.com
Re: Generating Dynamic radio button list
Posted by BlackKnight <ww...@gmail.com>.
Jim Kiley ??:
> You need to provide Struts with an actual List (or Set or the like). It
> looks like you are providing a single String. You will need to parse that
> String out into a List of Strings in order for <s:radio> to treat it as a
> List.
> jk
>
> 2009/6/24 BlackKnight <ww...@gmail.com>
>
>
>> Hi,
>>
>> I am trying to generate a dynamic raido buttom list using
>>
>> <s:radio name="%{optionname}" list="%{optionvalue}" />
>>
>> where optionvalue is stored in database equal
>>
>> #{'Faculty':'Faculty<BR>','Staff':'Staff<BR>','Resident':'Resident<BR>','Intern':'Intern<BR>'}
>>
>> however struts2 doesn't generate the radio button list intead he
>> generate only 1 radio button with value equals
>>
>> #{'Faculty':'Faculty<BR>','Staff':'Staff<BR>','Resident':'Resident<BR>','Intern':'Intern<BR>'}
>>
>> Any help?
>>
>>
>> Thanks!
>>
>>
>> Frank
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>
>
>
Hi, JK,
Thanks for your help ,
The problem is I am trying to generate a form from the DB. So the number
of radio button list could vary. That could make the parsing method
quite complex.(Actually I am not sure how to do that yet), any suggestions?
Frank
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org