1
h:messages
h:form
中的組件也顯示與外部組件相關的消息。使用單個h:message或h:messages顯示與h:form相關的所有消息?
如何限制它顯示僅與包含h:form
內部組件相關的消息?
我不喜歡用每個輸入組件的&單獨的h:message
標籤來擴充我的代碼。
使用Primefaces 3.4快照與JSF 2.2.0-M03
h:messages
h:form
中的組件也顯示與外部組件相關的消息。使用單個h:message或h:messages顯示與h:form相關的所有消息?
如何限制它顯示僅與包含h:form
內部組件相關的消息?
我不喜歡用每個輸入組件的&單獨的h:message
標籤來擴充我的代碼。
使用Primefaces 3.4快照與JSF 2.2.0-M03
可以使一個AJAX調用只呈現想要<h:messages
。 例如
<h:commandButton value="submit" actionListener="#{fooBean.submit}">
<f:ajax render="msgs"/>
</h:commandButton>
<h:messages id="msgs" globalOnly="true"/>
或primefaces的情況下使用更新屬性命令按鈕,使AJAX調用