MessageTo answer your specific question: Yes, it is ok to call setErrors and
setErrormessages as you suggest ( I assume you would be doing this only when
cancel was pressed).
Another option would be to override the validate() method (not only
doValidation) from ActionSupport and change it slightly to fit your needs.
Otherwise I think it sounds as if cancel should be a separate action, if it
was not for the gui/form problems. If you can use javascript you can use it
to change the form action so that the correct action is called, depending on
which button you pressed.

Cheers,

Dick Zetterberg
[EMAIL PROTECTED]


----- Original Message -----
From: Greinke, Ross
To: [EMAIL PROTECTED]
Sent: Thursday, July 10, 2003 10:56 PM
Subject: [OS-webwork] Clearing errors


None of the webwork examples demonstrate this idea, but I wanted to pass it
by the "experts" to make sure it doesn't break any WW conventions.

I'm on a form that has an update submit button and a cancel submit button.
Some of the fields have validation, so the error map may be set.

I'd still like the cancel button to bypass any errors and just go to the
view I have outlined in the views.properties file.

Is it OK to just call the superclass setErrors(null) and
setErrorMessages(null) in the doValidation() method?

That way I won't get field-level errors after hitting cancel, then have to
hit cancel AGAIN to *really* cancel.

I suppose I could put the cancel submit button in a separate form with a
completely separate action class that doesn't do much, but my buttons are
inside a table inside the form inside another table (which is pretty :)  and
I don't want to lose the look and feel.

Thanks in advance for all my "newbie" WebWork questions.  WebWork rocks!

Ross



-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to