Thursday, March 17, 2005
Tapestry in anger: pitfall #12141
You cannot validate your page when the form tag is in an embedded component because the IValidationDelegate.hasErrors() will not process the components form elements until it's too late.

So (pseudo code)
submit button [w/listener=page.doit]

form tag
form element w/validator defined
doIt() {
IValidationDelegate delegate = (IValidationDelegate) getBeans().getBean("validator");
// INVALID: form elements in component has not asked to validate yet!
boolean save = !delegate.getHasErrors();

So I rewrote this so the form tag is in the page and now it works fine.

Comments: Post a Comment

<< Home

Powered by Blogger