Ben wrote:
I meant this:

<form>
  <input type="text" name="name" value="$name">
  <input type="text" name="city" value="$address.city">
  <input type="text" name="zipcode" value="$address.zipcode">
  <input type="text" name="country" value="$address.country">
</form>

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.validate(); // Manually validate the data
}

When I call the validate method in my action to validate the userForm,
I would like it to validate the addressForm as well (with my custom
validate method).

Can I do something like this?

ActionErrors errors = userForm.validate(); // Validate the userForm
errors = userForm.address.validate(); // Validate the addressForm

So the errors variable would contains errors in userForm and addressForm.

Thanks,
Ben


Ben - I think you have it mostly correct, except that the call to userForm.address.validate(); should APPEND to errors, not overwrite it by using an equal sign.


Hopefully somebody will correct anything else that won't work :)


Matt

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



Reply via email to