You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sgarlata Matt <sg...@bah.com> on 2003/12/17 20:48:00 UTC

Checkboxes with session-scoped DynaActionForms

Does anyone know a good reference on how to use checkboxes with
session-scoped DynaActionForms?  The problem I am running into is that when
the form bean is session scoped, the checkbox "sticks" to always being
checked even if the user unchecks the checkbox.  This makes some sense to
me, because I know that if the checkbox is unchecked then a value for the
checkbox is not passed along in the request, so the old value is kept.  I
think with ActionForms this is solved by making the underlying property of
the checkbox of type boolean and by setting the value of the checkbox to
false in the reset() method of the ActionForm.  So, what is the correct
setup with DynaActionForms?  Should I make my underlying form property of
type java.lang.Boolean?  Also, It looks like I am going to have to subclass
DynaActionForm or DynaValidatorForm so that I can reset the checkboxes in
the reset() method of the form bean.  That seems like quite a pain (kind of
defeats the purpose of Dyna forms, doesn't it?).  Is that correct?

Thanks,

Matt


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