h:消息不显示JSF消息

h:消息不显示JSF消息,jsf,richfaces,Jsf,Richfaces,在我的JSF应用程序中,这里是我表单的一部分的简化版本: <h:form id="loginFormId"> <h:panelGrid columns="3"> <h:outputText value="Login :" /> <h:inputText label="Login" id="loginId" /> <rich:message for="loginId" ajaxRender

在我的JSF应用程序中,这里是我表单的一部分的简化版本:

<h:form id="loginFormId">
    <h:panelGrid columns="3">
        <h:outputText value="Login :" />
        <h:inputText label="Login" id="loginId" />
        <rich:message for="loginId" ajaxRendered="true"/>
        <f:facet name="footer">
            <a4j:commandButton value="OK" action="#{authentifierUtilisateurBean.authentifierUtilisateur}">
                <f:ajax execute="@form" render="@form" />
            </a4j:commandButton>
        </f:facet>
    </h:panelGrid>
</h:form>
我想根据AuthentifierUsilizateur方法中发生的某些情况,为与h:inputText关联的rich:message标记分配一个错误。 无法使用验证器,因为将从DB传递结果的方法是在AuthentifierUsilizateur方法中运行的

当我尝试上面的代码时,页面不会在h:inputText前面显示消息

如果我在表格中插入代码

<rich:messages />

在h:panelGrid中插入一个id,即

<h:panelGrid columns="3" id="grid">

让我知道这是否有帮助

FacesMessage由摘要和详细信息组成,rich:消息默认情况下将显示详细信息。那是你留下的空的,所以没有什么可显示的。请填写详细信息或设置@showSummary=true

谢谢您的帮助,但这不是我出错的原因。马克希尔的回答指出了我的错误。
        <f:facet name="footer">
            <rich:messages />
            <a4j:commandButton value="OK" action="#{authentifierUtilisateurBean.authentifierUtilisateur}">
                <f:ajax execute="@form" render="@form" />
            </a4j:commandButton>
        </f:facet>
addMessage("loginFormId:loginId", message)
<h:panelGrid columns="3" id="grid">
FacesContext.getCurrentInstance().addMessage("loginFormId:grid:loginId", message );