On Feb 17, 2008 12:46 PM, Chris Poulsen <[EMAIL PROTECTED]> wrote: > Hi, > > I've been trying to perform some cross field validation in 5.0.10, but > I'm unable to find any usable examples on how to get it working. > > I've added a "onValidateForm()" method to my page (and it is being > called properly) but if I want to indicate some error how do I do that?
> > Following an example on the wiki it says I should use > _form.recordError(). However recording an error (just the string, no > field) makes tapestry happily submit the form and continue to next page > as if no error was recorded. I think I read somewhere that is was not > necessary to manually check for errors as the first step in onSubmit(). > Please check the docs; the submit event is fired regardless of validation errors. You should provide an event handler for the success event instead. > I've also tried throwing a ValidationException but that brings up the > exception page. > > So could someone point me in the right direction here? > > PS. what I'm ultimately aiming for is a replacement for our old struts > construct that I think would look something like this in T5: > > Page: > void onValidateForm() { > _componentXXX.extraValidation(_form); > _componentYYY.extraValidation(_form); > } > > I would like it if it where possible to have T5 wire in the extra > validation methods automatically, so page developers shouldn't be forced > to remember which of the components that require extra validation, but i > guess I should get the basic case working before playing with that ;) > > -- > Chris > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]