struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bhaarat Sharma <bhaara...@gmail.com>
Subject Re: preselect value for radio tag
Date Fri, 10 Jul 2009 16:44:52 GMT
ah HAA
thats was my problem. the datatypes were different.

Thanks

On Fri, Jul 10, 2009 at 12:37 PM, Dale Newfield <dale@newfield.org> wrote:

> Bhaarat Sharma wrote:
>
>> I have a very simple radio tag like following
>> <s:radio label="correctOption" name="correctAnswer" id="correctOption"
>> list=" #{'1':'1','2':'2','3':'3','4':'4'}"
>> value="questionVo.correctAnswer"/>
>>
>> questionVo.correctAnswer returns 2. So I want the second radio button to
>> be
>> preselected but it is not happening. I even tried:
>>
>> <s:radio label="correctOption" name="correctAnswer" id="correctOption"
>> list=" #{'1':'1','2':'2','3':'3','4':'4'}" value="%{1}"/>
>>
>> but that does not work either.
>>
>> what am I doing wrong?
>>
>
>
> http://struts.apache.org/2.1.6/docs/why-wont-the-if-tag-evaluate-a-one-char-string.html
> Also, "%{1}" evaluates to a number, whereas "%{'1'}" evaluates to a char
> and '%{"1"}' evaluates to a string.
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message