模态JSF中的错误消息不´;行不通

模态JSF中的错误消息不´;行不通,jsf,jsf-2,richfaces,Jsf,Jsf 2,Richfaces,我在jsf中有一个xhtm,在jsf中有一个模态 在这个模式中,我有一个字段,我试图验证并返回一个错误 我的代码: 模态: <rich:popupPanel id="cancelssi" modal="true" width="500" height="280" zindex="2" domElementAttachment="form" show="#{demandasMB.showCancelar}" showWhenRendered="#{demandasMB.showCan

我在jsf中有一个xhtm,在jsf中有一个模态

在这个模式中,我有一个字段,我试图验证并返回一个错误

我的代码:

模态:

    <rich:popupPanel id="cancelssi" modal="true" width="500" height="280" zindex="2" domElementAttachment="form" show="#{demandasMB.showCancelar}" showWhenRendered="#{demandasMB.showCancelar}" >
    ...  


<h:panelGroup layout="block" class="area-input-100" id="idmotivocancelamentopanel">
                <h:panelGroup  class="label-campo">Justificativa de cancelamento:</h:panelGroup>    
                <h:inputTextarea styleClass="textarea-form-2-linhas" id="idmotivocancelamento" value="#{demandasMB.demandas.cnmmotivocancelamento}" maxlength="255"/>
                <h:message for="idmotivocancelamento" />                                    
            </h:panelGroup> 

            <h:panelGroup layout="block" class="clear"/>

            <h:panelGroup layout="block" styleClass="alinhaBotao">
                <h:commandButton value="Cancelar">
                    <f:ajax render="idmotivocancelamento idmotivocancelamentopanel" 
                                event="click"
                                listener="#{demandasMB.preCancelar()}"
                                execute="@form"
                                />
                </h:commandButton>          
                <h:commandButton value="Fechar"/>           
            </h:panelGroup>
    </rich:popupPanel>
我正在构建FacesMessage,但没有出现在我的modal中

我做错了什么


谢谢

您需要ajax更新
idmotivancelamentoppanel
,以反映您正在添加的
faces消息

另一种方法是使用
。使用
ajaxRendered=“true”
属性将允许在ajax请求时自动更新消息组件。因此,您将有:

<rich:message for="idmotivocancelamento" ajaxRendered="true"/>

<rich:message for="idmotivocancelamento" ajaxRendered="true"/>