igor.vaynberg wrote:
> 
> how about just page.onbeforerender() { fieldlastname.valdiate(); }
> 
> -igor
> 
Ok, thanks ..
But the RequiredTextField validates because it isn't added to the Page yet
(input is null and not an empty String) and so checkRequired() from
FormComponent returns true:

public boolean checkRequired()
{
  if (isRequired())
  {
    final String input = getInput();

    // when null, check whether this is natural for that component, or
    // whether - as is the case with text fields - this can only happen
    // when the component was disabled
    if (input == null && !isInputNullable())
    {
      // this value must have come from a disabled field
      // do not perform validation
      return true;
    }

    // peform validation by looking whether the value is null or empty
    return !Strings.isEmpty(input);
  }
  return true;
}


Thomas
-- 
View this message in context: 
http://www.nabble.com/How-can-I-validate-required-formComponents-after-page-load--tp14730931p14750961.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]

Reply via email to