struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <Wendy.Sm...@asu.edu>
Subject RE: form processing
Date Thu, 20 May 2004 14:45:51 GMT
> From: Dean A. Hoover [mailto:dhoover@rochester.rr.com] 
> I don't quite understand how DynaActionForm
> gets populated when a form is submitted. The
> form I have gets processed exactly as I expect,
> except for a group of checkboxes

(This is a FAQ-- the answer is in the list archives multiple times.)

Un-checked checkboxes are not successful form elements and will not be
present in the request.  

You need to clear all of the checkboxes prior to Struts' populating the
form from the request.  There are several ways to do this, the most
popular of which is to override the 'reset' method and set the checkbox
properties to false.  With dynamic forms, there's an 'initialize' method
that will initialize the form based on the info in struts-config.xml.
You can call that from 'reset'.  If you are using DynaActionForm
directly, you'll need to subclass it to provide the 'reset' method.

If you don't do this, as you've noticed, it's impossible to ever
un-check a checkbox on your form.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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


Mime
View raw message