AjaxValidation demo

Description
This page displays a ajaxValidation on a textfield containing already a Tapestry validation.
Both validations can be stacked.
In this example, the Tapestry validation force to minlength=5, the ajaxValidation force to 7 maximum characters.


In Action
Login :




TML Source code

		<t:form>
			Login : <t:textfield t:id="login" value="loginValue"
				t:mixins="exanpe/ajaxValidation"
				t:validate="minlength=5"/>
			<br/><br/>
			<t:submit/>
		</t:form>
	



Java code

  	@Property
    private String loginValue;

    @OnEvent(value = ExanpeEventConstants.AJAXVALIDATION_EVENT, component = "login")
    public AjaxValidationResult validateLogin(String login)
    {
        if (login != null && login.length() < 7)
            return AjaxValidationResult.TRUE;

        return AjaxValidationResult.FALSE;
    }