ListEdit forms with form level validation.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ListEdit forms with form level validation.

Erik Husby
I have a multi-record form where I need to do validation between fields.

If I have a multi-record form where the validation is simple and can use
a number validator with let say, a minimum value, Tapestry will
correctly indicate the specific field in the specific record as being in
error.

How do I do that with my form level validation? If during my submit
listener, I scan the set of records and do the equivalent of
IValidationDelegate delegate...
for each record in the form
    if field A is in error then
       delegate.setFormComponent( getComponent("fieldA"));
       delegate.record(new ValidatorException("field A in error"))
    end if
end fo

When the page is rendered, the field error indicator is always on the
last record, not the record in error.

How do I tell the validation delegate which record is in error?

--
Erik Husby
Senior Software Engineer
Broad Institute of MIT and Harvard
Rm. 2192  320 Charles St, Cambridge, MA 02141-2023
mobile: 781.354.6669, office: 617.258.9227,
email: [hidden email]  AIM: ErikAtBroad


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]