struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Gordon <>
Subject Re: html:checkbox issue
Date Thu, 10 Aug 2006 17:23:42 GMT

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: 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...


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.
> -Dave
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message