Re: Avoiding validate event after canceled from BeanEditForm
I had the same problem, and did't know about ValidationTracker.clear. I solved this problem by using a flag. on selected from cancel button i set it to true and in validation event i'd first check the flag, if true record error and return. i'll try the ValidationTracker now though. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Avoiding-validate-event-after-canceled-from-BeanEditForm-tp4616049p4621963.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Avoiding validate event after canceled from BeanEditForm
Hi all! I have a t:beaneditform with t:cancel=true When I click on cacel, I handle it with a onCanceledFromMyForm() handler, and here return another page. My problem is that after the canceled event the validate is fired, and my onValidateFromMyForm() handler is called, recording form errors shown when I return to this page. I suppose that the validate event shouldn't be fired after canceled one, don't you? Or is there another way to handle with this scenario, perhaps? The only work arround I found, is having a boolean page field, set to true in onCanceled handler and checking it in onValidate one... but I think it is quite tricky... I'll apreciate any advise! Regards, Matias.
Re: Avoiding validate event after canceled from BeanEditForm
Hi Matias, you could call ValidationTracker.clear in your onCancel method. The ValidationTracker is pushed onto the Environment by the Form. You'll get by adding @Environmental private ValidationTracker tracker; to your page-/component class. Regards nillehammer - http://www.winfonet.eu -- View this message in context: http://tapestry.1045711.n5.nabble.com/Avoiding-validate-event-after-canceled-from-BeanEditForm-tp4616049p4616607.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org