RE: Session form resetted after each post (struts 1.0.2)

2002-08-28 Thread Miguel Angel Mulero Martinez

It's a feature. You should use reset() to prepare the ActionForm to get the
HTML form values. If the form has multiple steps you don't have to erase the
contents of the bean in the reset() function. You can use an input
type=hidden ...  to know in wich step are you, and actuate in concordance.



-Mensaje original-
De: Eelco Klaver [mailto:[EMAIL PROTECTED]]
Enviado el: miércoles, 28 de agosto de 2002 12:59
Para: 'Struts Users Mailing List'
Asunto: Session form resetted after each post (struts 1.0.2)

Hi,

I have a session scope action form to enable filling in the form in multiple
steps. I noticed that the reset method is called everytime the html form is
posted, while I would expect that this method is only called the first time.
I this a bug or a feature?

Regards, Eelco


--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Session form resetted after each post (struts 1.0.2)

2002-08-28 Thread Eelco Klaver

Thanks for the reply. I guess I misused the reset method to initialize all
values to their default value, which is ok for request scope forms but
doesn't work for session scope forms. I'll find another way to do this.

 -Original Message-
 From: Miguel Angel Mulero Martinez
 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, August 28, 2002 1:21 PM
 To: Struts Users Mailing List
 Subject: RE: Session form resetted after each post (struts 1.0.2)


 It's a feature. You should use reset() to prepare the
 ActionForm to get the
 HTML form values. If the form has multiple steps you don't
 have to erase the
 contents of the bean in the reset() function. You can use an input
 type=hidden ...  to know in wich step are you, and actuate
 in concordance.



 -Mensaje original-
 De: Eelco Klaver [mailto:[EMAIL PROTECTED]]
 Enviado el: miércoles, 28 de agosto de 2002 12:59
 Para: 'Struts Users Mailing List'
 Asunto: Session form resetted after each post (struts 1.0.2)

 Hi,

 I have a session scope action form to enable filling in the
 form in multiple
 steps. I noticed that the reset method is called everytime
 the html form is
 posted, while I would expect that this method is only called
 the first time.
 I this a bug or a feature?

 Regards, Eelco


 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]


 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Session form resetted after each post (struts 1.0.2)

2002-08-28 Thread Andrew Hill

You need the reset method to clear values for checkbox fields (and a few
others (ie select fields), but Ill use the checkbox example here). Otherwise
if you tick a checkbox, you can not untick it - the browser does not submit
anything for that field (ie: an unticked checkbox) and so the value in your
actionForm will not be updated, and so you will not pick up the fact that
the user unticked the box.
Your reset method is there to deal with situation. Reset is called before
the form is populated. Thus the value for that field in the actionForm is
cleared. If the checkbox is still ticked, the field will be repopulated in
the actionForm, if however the user unticked the checkBox, the actionForm
will reflect this. (Which it wouldnt if you didnt clear that field in the
reset method)

-Original Message-
From: Eelco Klaver [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 28, 2002 19:34
To: 'Struts Users Mailing List'
Subject: RE: Session form resetted after each post (struts 1.0.2)


Thanks for the reply. I guess I misused the reset method to initialize all
values to their default value, which is ok for request scope forms but
doesn't work for session scope forms. I'll find another way to do this.

 -Original Message-
 From: Miguel Angel Mulero Martinez
 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, August 28, 2002 1:21 PM
 To: Struts Users Mailing List
 Subject: RE: Session form resetted after each post (struts 1.0.2)


 It's a feature. You should use reset() to prepare the
 ActionForm to get the
 HTML form values. If the form has multiple steps you don't
 have to erase the
 contents of the bean in the reset() function. You can use an input
 type=hidden ...  to know in wich step are you, and actuate
 in concordance.



 -Mensaje original-
 De: Eelco Klaver [mailto:[EMAIL PROTECTED]]
 Enviado el: miércoles, 28 de agosto de 2002 12:59
 Para: 'Struts Users Mailing List'
 Asunto: Session form resetted after each post (struts 1.0.2)

 Hi,

 I have a session scope action form to enable filling in the
 form in multiple
 steps. I noticed that the reset method is called everytime
 the html form is
 posted, while I would expect that this method is only called
 the first time.
 I this a bug or a feature?

 Regards, Eelco


 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]


 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Session form resetted after each post (struts 1.0.2)

2002-08-28 Thread Miguel Angel Mulero Martinez

The simple way to do this, is put the bean in session request, and in each
stage make a submit to an Action that forwards the control to the next stage
(JSP). The Action can be the same in all stages (final too), but with an
attribute you can indicate to the Action wich is the next step to forward.


-Mensaje original-
De: Eelco Klaver [mailto:[EMAIL PROTECTED]]
Enviado el: miércoles, 28 de agosto de 2002 13:34
Para: 'Struts Users Mailing List'
Asunto: RE: Session form resetted after each post (struts 1.0.2)

Thanks for the reply. I guess I misused the reset method to initialize all
values to their default value, which is ok for request scope forms but
doesn't work for session scope forms. I'll find another way to do this.

 -Original Message-
 From: Miguel Angel Mulero Martinez
 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, August 28, 2002 1:21 PM
 To: Struts Users Mailing List
 Subject: RE: Session form resetted after each post (struts 1.0.2)


 It's a feature. You should use reset() to prepare the
 ActionForm to get the
 HTML form values. If the form has multiple steps you don't
 have to erase the
 contents of the bean in the reset() function. You can use an input
 type=hidden ...  to know in wich step are you, and actuate
 in concordance.



 -Mensaje original-
 De: Eelco Klaver [mailto:[EMAIL PROTECTED]]
 Enviado el: miércoles, 28 de agosto de 2002 12:59
 Para: 'Struts Users Mailing List'
 Asunto: Session form resetted after each post (struts 1.0.2)

 Hi,

 I have a session scope action form to enable filling in the
 form in multiple
 steps. I noticed that the reset method is called everytime
 the html form is
 posted, while I would expect that this method is only called
 the first time.
 I this a bug or a feature?

 Regards, Eelco


 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]


 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]