You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Suneel <su...@gmail.com> on 2009/06/18 19:30:55 UTC

struts 2: checkbox fieldvalue and value - what's the difference? strange behavior with non boolean values

Hi,

I'm trying to understand the different between fieldValue and value
attributes of the checkbox tag.

I'm asking this because the checkbox is unchecked even though the
field associated with it has the same value as the fieldValue. (i.e
redemption.countryNotice=="N")
<s:checkbox name="redemption.countryNotice" fieldValue="%{'N'}"></s:checkbox>

But when I have it as this:
<s:checkbox name="redemption.countryNotice" fieldValue="%{'N'}"
value="%{'N'}"></s:checkbox>
the chekbox shows up as checked

The problem with this is that it always comes up as checked even if
the value is not equal to "N".


What am I doing wrong?

-- 
Thanks
Suneel

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