struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Jesse <alexander.je...@csfs.com>
Subject RE: reset() in FormBean
Date Fri, 02 Nov 2001 09:48:39 GMT
Hi,

check in the code...

first: reset()
then:  populate()
at last: validate()

You need to do it, if you have checkboxes on your form, cause their value 
is only transmitted if they are set. Without the reset-methode you have
no knowledge when the user deselects them. Easy to try and then you know 
why the reset() is there.
Whether you use setXXX() or just do xXX = any_value does not harm.

hope this helps
Alexander

-----Original Message-----
From: Tolstoy.Patel@us.cgeyc.com [mailto:Tolstoy.Patel@us.cgeyc.com]
Sent: Thursday, November 01, 2001 1:30 AM
To: struts-user@jakarta.apache.org
Subject: reset() in FormBean




When is the reset() method of the FormBean called?  I know the FormBean's
fields are first populated, then it's validate() method is called (if
validate="true" in the struts-config.xml), and then the perform() method of
the associated Action class is called.  -But when is the reset() called?
-If I override the method, do I call a series of setXXXX() methods to
default values. -Is it not a good idea to override the method? Should I
leave it at the default behavior? Any help would be much appreciated.
Thanks.  -T-


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

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


Mime
View raw message