struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Gordon <adam.gor...@readytalk.com>
Subject Re: html:checkbox issue
Date Thu, 10 Aug 2006 17:23:42 GMT
David-

Since I've only one checkbox, I think that's way overkill...regardless, 
I should take back my prior comment about the documentation for struts:

http://struts.apache.org/1.x/struts-taglib/tlddoc/index.html has a 
WARNING about how to make struts have the ability to detect unchecked 
checkboxes.  It's amazing how RTFM results in user education...

Incidentally, I believe this is basically the same as what Kalpesh 
suggests in the follow up email...

-Adam

David Durham wrote:
> Adam Gordon wrote:
>> I've got an html:checkbox in a form and the property is 
>> mapped/spelled correctly to the field/method in the bean.  The 
>> behavior I am seeing is that the bean property (a boolean) is not 
>> being set based on the state of the checkbox.
>>
>> I fired up Ethereal and following the TCP stream from the POST, I can 
>> see the name of the property being passed (<property name>=on) as a 
>> parameter on the request if the checkbox is checked, but if it is not 
>> checked, the parameter doesn't show up at all on the request (I'd 
>> expected <property name>=off) but this might be the reason that 
>> Struts can't set the property if it doesn't know the value....
>>
>> Obviously, I can issue a request.getParameter(<property name>) and if 
>> it returns null, set the property on the bean myself, but I had hoped 
>> Struts would do this for me...
>>
>> Anyone run into this before or have any suggestions?  Thanks.
>
> Try using multibox.  I think it will do what you need.
>
> http://husted.com/struts/tips/007.html
>
> -Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org

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


Mime
View raw message