當單擊按鈕但對話框應該顯示爲不隱藏時,我需要在對話框中顯示的JSF驗證消息。JSF驗證當按鈕單擊時,對話框中的消息顯示
<h:form prependId="false">
<h:panelGrid columns="1" cellpadding="5">
<p:commandButton value="Modal" onclick="dlg2.show();" type="button" />
</h:panelGrid>
<p:dialog header="Modal Dialog" widgetVar="dlg2" modal="true" height="200" width="400">
<h:panelGrid columns="1" >
<p:messages />
<p:inputText id="txt" value="#{converterBean.doubleValue}" required="true"/>
<p:commandButton ajax="false" value="Submit" action="#{converterBean.submit}" />
</h:panelGrid>
</p:dialog>
</h:form>