Not 100% sure why the gurus dont like it.

Perhaps for the same reason they dont like the idea of configuring whether
or not to populate the form - because it will encourage action chaining -
which if not done very carefully can lead to a whole lot of difficulties.

In my case I found that having the decision of whether or not to reset was
best made in the actionform reset itself (a common and non-controversial
technique) based on some parameter sent with the request - this being
because for the same action I sometimes needed to reset, and sometimes not
and the decision was thus a runtime one.

I do however think there should be a standard option in the mappings to
allow one to switch off reset(), populate() - and even the form creation!
Theres already one to switch off validation. I rather suspect the gurus will
disagree though ;-)

-----Original Message-----
From: ROSSEL Olivier [mailto:[EMAIL PROTECTED]]
Sent: Friday, 24 January 2003 18:52
To: '[EMAIL PROTECTED]'; Struts Users Mailing List
Subject: RE: Why is the reset method called when I submit the form?


> <snip>
> The problem is that you cannot control the reset-populate-validate
> cycle.
> </snip>
>
> You can if you override the RequestProcessor :-)
>
> Ive actually had to do something similar in regards to form
> population and
> form instantiation , in which I defined my own ActionMapping
> class to define
> properties to configure these steps and then overridden the
> appropriate
> methods in the RequestProcessor to check for it.
>
> The same principle could be applied to reset, though in this
> case Im just
> using the simple if parameter=... type check described in the
> message you
> replied to...
>
> btw: Ive had to cc this email to you directly since all my
> posts to the
> struts list over the last few days have been failing (some dns problem
> somewhere!)

It seems that there are technical solutions to this problem.
The parameter solution is a bit too restrictive for me,
cause I already use parameter for several nice actions I made.
Now that I know you can add <set-property> to the action mapping,
it sounds a very good alternative.

My question is: would it be interesting to add a "resetForm" attribute
to the <action> tag. It would be optionnal, with default value to "true".

Gurus seem not to like this idea.

This e-mail is intended only for the above addressee. It may contain
privileged information. If you are not the addressee you must not copy,
distribute, disclose or use any of the information in it. If you have
received it in error please delete it and immediately notify the sender.
Security Notice: all e-mail, sent to or from this address, may be
accessed by someone other than the recipient, for system management and
security reasons. This access is controlled under Regulation of
Investigatory Powers Act 2000, Lawful Business Practises.

--
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]>

Reply via email to