|
Page Created :
WICKET :
Validating Form Components (After Page Load)
Validating Form Components (After Page Load) has been created by Will Hoover (Jan 11, 2008). Content:To validate a form component before after a page loads add the following to the form component ... protected void onBeforeRender() { super.onBeforeRender(); visitChildren(FormComponent.class, new IVisitor() { public Object component(Component component) { FormComponent formComponent = (FormComponent) component; if (formComponent.isRequired()) { // This can be any validator formComponent.error((IValidationError)new ValidationError().addMessageKey("Required")); } return IVisitor.CONTINUE_TRAVERSAL_BUT_DONT_GO_DEEPER; } }); } ... |
Powered by
Atlassian Confluence
(Version: 2.2.9 Build:#527 Sep 07, 2006)
-
Bug/feature request
Unsubscribe or edit your notifications preferences
Unsubscribe or edit your notifications preferences
