Re: Nested form validation

2004-12-10 Thread Ben
Thanks, I am doing just that. Just a quick question, how do I use the property name as the error key in the validate() method? I have this but it uses the form name as the key, not the name of the property currently validating. public ActionErrors validate(ActionMapping mapping, HttpServletReque

Re: Nested form validation

2004-12-10 Thread Hubert Rabago
I would think so, but you'd have to call Validator yourself. Take a look at how the ValidatorForm#validate() calls it, and base your nested.validate() code on that. After the call, append the errors from your main form and those in your nested form. On Fri, 10 Dec 2004 10:41:36 +1100, Ben <[EMAI

Re: Nested form validation

2004-12-09 Thread Matt Bathje
Ben wrote: I meant this: UserForm () { String name; AddressForm address = new AddressForm(); } AddressForm () { String city; String zipcode; String country; validate(...) { // validate the address } } UserAction () { UserForm userForm = (UserForm) form; ActionErrors errors = userForm.

Re: Nested form validation

2004-12-09 Thread Ben
I meant this: UserForm () { String name; AddressForm address = new AddressForm(); } AddressForm () { String city; String zipcode; String country; validate(...) { // validate the address } } UserAction () { UserForm userForm = (UserForm) form; ActionErrors errors = userForm.valida

Re: Nested form validation

2004-12-09 Thread Hubert Rabago
Why not call nested.validate() inside NormalForm#validate(), then add the appropriate ActionMessage objects in the resulting ActionErrors? On Fri, 10 Dec 2004 08:57:17 +1100, Ben <[EMAIL PROTECTED]> wrote: > Hi > > Within my normal form there is a nested form. The nested form has > custom valida

Re: Nested form validation

2004-12-09 Thread Matt Bathje
Are you talking something like If so, then its most likely not possible. Furthermore, it is not standard HTML, and not guaranteed to work on any browser - whatever you are doing with nested forms needs to be rethought so as not to use them. If that is not what you are talking abo

Nested form validation

2004-12-09 Thread Ben
Hi Within my normal form there is a nested form. The nested form has custom validation. The validate attribute of the action is set to false. My question is how do I validate the normal form and automatically validate the nested form with my custom validation method? E.g. NormalForm () { NestedF