You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sean Giles <Se...@trx.com> on 2001/03/09 21:43:34 UTC

actionform reset()

I'm very confused by the behavior of the reset() method.  

We populate a page from an action form with request scope which works fine,
however unless a property is actually used on the form it does not get
repopulated after the reset() method.  

for example:
If I don't use <html:text property="address1"/> or <html:hidden
property="address"/> the reset() sets this property to null it will not be
re-populated.  System.out shows the property has a value right before the
reset method?  

Is this by design or am I doing something in correctly?  If it is by design
how are multi-page forms supposed to be handled that only display a subset
of an actionform object?


Thanks
Sean 

Re: actionform reset()

Posted by Martin Cooper <ma...@tumbleweed.com>.
The reset() method is called immediately before the bean is populated with
the parameters from a request. For multi-page forms, you typically do not
want your reset() method to zap everything. In this case, you will most
likely use a hidden field to identify the page being submitted, and base
your reset() implementation on the value of that hidden field.

Hope this helps.

--
Martin Cooper


----- Original Message -----
From: "Sean Giles" <Se...@trx.com>
To: <st...@jakarta.apache.org>
Sent: Friday, March 09, 2001 12:43 PM
Subject: actionform reset()


> I'm very confused by the behavior of the reset() method.
>
> We populate a page from an action form with request scope which works
fine,
> however unless a property is actually used on the form it does not get
> repopulated after the reset() method.
>
> for example:
> If I don't use <html:text property="address1"/> or <html:hidden
> property="address"/> the reset() sets this property to null it will not be
> re-populated.  System.out shows the property has a value right before the
> reset method?
>
> Is this by design or am I doing something in correctly?  If it is by
design
> how are multi-page forms supposed to be handled that only display a subset
> of an actionform object?
>
>
> Thanks
> Sean