sipXconfig
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 mypage.page (pseudo code)
mycomponent
submit button [w/listener=page.doit]

mycomponent.jwc
form tag
form element w/validator defined


MyPage.java
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