Dúvida rich:message

4 respostas
Marcio_Nogueira

Estou trabalhando em uma tela de login utilizando o rich:message, porém ao enviar o form vazio, nenhuma mensagem de erro aparece. Alguém poderia ajudar?
Desde já agradeço a atenção.

4 Respostas

Marcio_Nogueira

Não sei se tem a ver, mas coloquei o rich:message dentro de um h:panelGroup. Pode ser isso que está causando o erro?
Segue abaixo o código do meu jsp de login:

<%@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>
            <f:verbatim><div align="center"></f:verbatim>
                <rich:panel style="width:236px;">
                <f:facet name="header">
                    <h:outputLabel value="Tela de Login"/>
                </f:facet>
                    <h:panelGrid columns="2">
                        <h:panelGroup>
                            <h:outputLabel id="lblLogin" for="txtLogin" value="Usuário:"/>
                        </h:panelGroup>
                        <h:panelGroup>
                            <h:inputText id="txtLogin" required="ture" value="#{aluno.login}">
                                <f:validateLength minimum="8"/>
                            </h:inputText>
                            <rich:message for="txtLogin">
                                <f:facet name="ok">
                                    <h:graphicImage value="/img/passed.gif"/>
                                </f:facet>
                                <f:facet name="erro">
                                    <h:graphicImage value="/img/error.gif"/>
                                </f:facet>
                            </rich:message>
                        </h:panelGroup>
                        <h:panelGroup>
                            <h:outputLabel id="lblSenha" for="txtSenha" value="Senha:"/>
                        </h:panelGroup>
                        <h:panelGroup>
                            <h:inputSecret id="txtSenha" required="ture" value="#{aluno.senha}">
                                <f:validateLength minimum="8"/>
                            </h:inputSecret>
                            <rich:message for="txtSenha">
                                <f:facet name="ok">
                                    <h:graphicImage value="/img/passed.gif"/>
                                </f:facet>
                                <f:facet name="erro">
                                    <h:graphicImage value="/img/error.gif"/>
                                </f:facet>
                            </rich:message>
                        </h:panelGroup>
                    </h:panelGrid>
                    <h:panelGrid columns="1">
                        <h:panelGroup style="align:center;">
                            <a4j:commandButton id="cmdLogin" value="Efetuar Login" action="#{aluno.validarDados}"/>
                        </h:panelGroup>
                    </h:panelGrid>
            </rich:panel>
            <f:verbatim></div></f:verbatim>
        </body>
    </html>
</f:view>
P

voce notou que no required esta “ture” ao inves de “true”?

Marcio_Nogueira

É mesmo! Que distração! Obrigado por ter visto, não tinha percebido isso. Um abraço, tudo de bom!

Marcio_Nogueira

O problema ainda persiste, as mensagens de erro não são exibidas.

Criado 7 de outubro de 2009
Ultima resposta 7 de out. de 2009
Respostas 4
Participantes 2