You should clean the form only on input phase. Thus, you need to
somehow distinguish input phase from render phase since reset() does
not make this distinction. If you always submit a form using POST, you
can assume that POST means input phase. Or, you can check for a
certain parameter in the request (event) and if it is there, you can
assume that this is input phase.

Read here for some insights:
http://struts.sourceforge.net/strutsdialogs/dialogaction.html

If you can switch to 1.2.9, it contains EventActionDispatcher that
makes DialogAction obsolete. See also here:

http://wiki.apache.org/struts/DataEntryForm
http://wiki.apache.org/struts/EventActionDispatcher

Remember, you task is:

* to distinguish between input phase and render phase
* to ensure that request corresponding to render phase contained no
paramaters, otherwise you would have to check current phase in every
setter on your form.

This is all needed if you want to use redirect. If you simply ok with
forwarding to the same page after adding a row, than above techniques
are not needed.

Michael.

On 3/22/06, Marcio Ghiraldelli <[EMAIL PROTECTED]> wrote:
>     Hello,
>
>     I am facing a strange ActionForm Reset behavior with Struts 1.2:
>
>     I want after submit a form, redirect via controler to the same form (so 
> the user can submit it subsequently times).
>     Should the normal behavior be:
>
>     1) Controler receives the first request (Action.do)
>     2) My Action class populate the request properly
>     3) Controler redirects to the form view
>     4) View calls an ActionForm (request scope)
>     5) ActionForm Reset method is executed, accessing the request properly
>     6) User submits the Form (ActionSubmit.do)
>     7) Controler redirects to ActionSubmit.class
>     8) ActionSubmit works ok, and return a Forward to recall the Action.do
>
>     The steps above should implement a loop of subsequently submits (for 
> adding itens in a list by example) but after the first submit, in the second 
> step, the reset method is executed BEFORE the Action.do, with an empty 
> request, breaking down the view proccess, 'couse the form isn't populated 
> correctly.
>
>     What's happening here?
>

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

Reply via email to