<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="rich" uri="http://richfaces.org/rich"%>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<%--
    This file is an entry point for JavaServer Faces application.
--%>
<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>JSP Page</title>
        </head>
        <body>
            <h:form>
            <rich:panel header="Testes AJAX">
                <h:panelGrid columns="3">
                    <h:outputText value="Nome:"/>
                    <h:inputText required="true" id="nome">
                        <f:validateLength minimum="5" maximum="20"/>
                        <rich:ajaxValidator event="onblur"/>
                    </h:inputText>
                    <rich:message for="nome"/>

                    <h:outputText value="Idade:"/>
                    <h:inputText required="true" id="idade">
                        <f:validateLongRange minimum="18" maximum="100"/>
                        <f:convertNumber integerOnly="true"/>
                        <rich:ajaxValidator event="onblur"/>
                    </h:inputText>
                    <rich:message for="idade"/>
                </h:panelGrid>
            <h:outputText value="Para testar, digite valores fora da faixa permitida (o nome tem que ter entre 5 e 20 caracteres, e a idade
            precisa ser entre 18 e 100 anos)."/>

            </rich:panel>

            </h:form>
        </body>
    </html>
</f:view>
