Boa Tarde, Pessoal!
Estou fazendo um mini cadastro e preciso validar se os 2 campos foram preenchidos.
Coloquei o requerid = true e o h:message, porém a mensagem de validação não aparece e no console mostra a seguinte mensagem:
“ERROR [HtmlResponseStateManager] No component states to be saved in client response!”
Segue o código.
[code]<!doctype html public “-//w3c//dtd html 4.0 transitional//en”>
<%@ taglib uri=“http://java.sun.com/jsf/core” prefix=“f” %>
<%@ taglib uri=“http://java.sun.com/jsf/html” prefix=“h” %>
<%@ taglib uri=“http://richfaces.org/a4j” prefix=“a4j”%>
<%@ taglib uri=“http://richfaces.org/rich” prefix=“rich”%>
<style type="text/css">
.btn {
width:80px;
height:25px;
font-size: 11px;
font-family: arial,sans-serif;
font-weight:bold;
cursor: pointer;
text-align: center;
border-top-width: 0px;
border-right-width: 0px;
border-bottom-width: 0px;
border-left-width: 0px;
}
.inputText {
width:300px;
height:20px;
font-size: 11px;
font-family: arial,sans-serif;
text-align: left;
border-top-width: 0px;
border-right-width: 0px;
border-bottom-width: 0px;
border-left-width: 0px;
border-top-color:#E6E8FA;
border-right-color:#E6E8FA;
border-bottom-color:#E6E8FA;
border-left-color:#E6E8FA;
background-color: #E6E8FA;
}
.outputText {
font-size: 11px;
font-family: arial,sans-serif;
font-weight:bold;
}
.rich-painel {
border-top-color:#dfa5a5;
border-right-color:#dfa5a5;
border-bottom-color:#dfa5a5;
border-left-color:#dfa5a5;
background-color: rgb(248, 236, 236);
}
.rich-painel-header {
border-top-color:#dfa5a5;
border-right-color:#dfa5a5;
border-bottom-color:#dfa5a5;
border-left-color:#dfa5a5;
background-color: rgb(248, 236, 236);
}
.col1 { width: 40px; }
.col2 { width: 150px; }
.col3 { width: 150px; }
}
</style>
<f:view>
<h:form>
<rich:panel header="Cadastro de Remetentes - Incluir" style="width: 625px" >
<h:messages errorStyle="color:red" infoStyle="color:#5ac67e" />
<h:panelGrid columns="3" columnClasses="col1, col2, col3">
<h:outputText value="Nome:" styleClass="outputText"/>
<h:inputText id="nome" value=" " styleClass="inputText" required="true" />
<h:message for="nome"/>
<h:outputText value="Email:" styleClass="outputText"/>
<h:inputText id="email" value=" " styleClass="inputText" required="true" />
<h:message for="email" />
</h:panelGrid>
<h:panelGrid columns="2">
<h:commandButton value="Salvar" styleClass="btn" />
<h:commandButton value="Cancelar" styleClass="btn" />
</h:panelGrid>
</rich:panel>
</h:form>
</f:view>
</body>
[/code]
Agradeço desde já pela ajuda!