jelything wrote the following on 3/18/2005 1:40 PM:
I have a DynaValidatorForm that holds many items, including an
ArrayList of DynaValidatorForms.  Calling validate() on the main form
works just fine, but how do I get the nested forms to validate?

If I iterate through the ArrayList, and cast them back to a
DynaValidatorForm and then simply call validate on them, I get:

java.lang.NullPointerException at
org.apache.struts.validator.DynaValidatorForm.validate(DynaValidatorForm.java:144)

Any ideas?

Ok couple of things...

1) I would NOT nest forms. I think that's just asking for trouble. I would simply use ONE form and have your collection a s property in that form. (The of course your collection can hold objects which have collections..etc etc). But just nest a collection of beans, or even one bean with the collections inside.

2) I'm not sure how declarative validation works over nested objects (using validation rules). I know when I have a lot of nested objects (which I do quite often), I find it easiest to just create my own validation (Recurse over the nested objects and perform the checks).

--
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to