You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mikkel Bruun <mi...@valtech.dk> on 2001/06/04 19:40:26 UTC

Resetting an Action Form (urgent)

Hi Guys, 

Please help me out on this one...

I ran in to a small problem...

1. In the system im developing the user has to go through several pages,
entering information that needs to be processed...
2. When ever the user enters invalid data, he'si returned to the form and is
presented to error messages...
3. The user should be able to press the bacl button, or user other means to
navigating backwards in the process. When navigating backwards the forms
should be populated with whatever data he has entered...

(of course all the above is straight forwrd implemented in struts, but check
this)

4. After the user has completed the entire proces, he is able to do it one
more time. 
This time the forms should not "remember" what the user previuosly entered,
and should therefor be blank...

To give a more substantial example...it could be an insurance broker who
would do several calculations on an house insurance for each customer...
Each calculation should be isolated from each other...

Is there a simple way to do this???

At the moment there no coupling between my ActionForms and my Logic Beans
(ie no association or anything)...

Could I use the transaction token??? and if so, is there any documentation
for the transaction token!!

thanks in advance

Mikkel



Re: Resetting an Action Form (urgent)

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 4 Jun 2001, Mikkel Bruun wrote:

> Hi Guys, 
> 
> Please help me out on this one...
> 
> I ran in to a small problem...
> 
> 1. In the system im developing the user has to go through several pages,
> entering information that needs to be processed...
> 2. When ever the user enters invalid data, he'si returned to the form and is
> presented to error messages...
> 3. The user should be able to press the bacl button, or user other means to
> navigating backwards in the process. When navigating backwards the forms
> should be populated with whatever data he has entered...
> 
> (of course all the above is straight forwrd implemented in struts, but check
> this)
> 
> 4. After the user has completed the entire proces, he is able to do it one
> more time. 
> This time the forms should not "remember" what the user previuosly entered,
> and should therefor be blank...
> 
> To give a more substantial example...it could be an insurance broker who
> would do several calculations on an house insurance for each customer...
> Each calculation should be isolated from each other...
> 
> Is there a simple way to do this???
> 
> At the moment there no coupling between my ActionForms and my Logic Beans
> (ie no association or anything)...
> 
> Could I use the transaction token??? and if so, is there any documentation
> for the transaction token!!
> 
> thanks in advance
> 
> Mikkel
> 
> 
> 

How about just deleting the old form bean instance and creating a new
one?  Alternatively, you could add a method to reinitalize all the values
back to their original defaults.

Craig