Add/Edit if necessary http://cwiki.apache.org/confluence/x/sCEB

-----Original Message-----
From: thomas jaeckle [mailto:[EMAIL PROTECTED]
Sent: Friday, January 11, 2008 3:13 AM
To: [email protected]
Subject: Re: How can I validate required formComponents after page load?





igor.vaynberg wrote:
> 
> onbeforerender {
>   textfield.error(RequiredValidator.class.getSimpleName());
> }
> 
> -igor
> 
Thanks igor.

Now it is working fine with:

protected void onBeforeRender()
{
  super.onBeforeRender();

  visitChildren(FormComponent.class, new IVisitor()
  {
    public Object component(Component component)
    {
      FormComponent formComponent = (FormComponent) component;
      if (formComponent.isRequired())
      {
        formComponent.error((IValidationError)new
ValidationError().addMessageKey("Required"));
      }
      return IVisitor.CONTINUE_TRAVERSAL_BUT_DONT_GO_DEEPER;
   }
  });
}
-- 
View this message in context: 
http://www.nabble.com/How-can-I-validate-required-formComponents-after-page-load--tp14730931p14751493.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to