This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Child pages
  • Validating Form Components (After Page Load)
Skip to end of metadata
Go to start of metadata

To validate a form component after page load add the following to the page

...

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;
    }
  });
}

...
  • No labels