我有一個問題,因爲我想保持一個Primefaces對話框打開,但每次按下注冊按鈕時,它都會關閉。需要保持打開Primefaces對話框
這樣,當數據加載良好時,不會是一個大問題。由於它們被記錄在數據庫中並且操作結束。
我的目的是讓對話框保持在屏幕上,直到我決定用另一個按鈕關閉它。這是因爲如果驗證引發錯誤,則應該保留,直到它們更正數據或決定不註冊。
附對話框代碼:
<h:form id="frmAltaCombustible">
<p:dialog header="Nuevo Combustible" widgetVar="dialogoNuevoCombustible" resizable="false" width="900" showEffect="explode" hideEffect="explode" >
<p:panelGrid id="nuevoCombustible" columns="3">
<p:outputLabel value="Identificador de Combustible:" for="txtIdentificador"/>
<p:inputText id="txtIdentificador" label="Identificador" value="#{mbCombustibles.combustible.idcombustible}">
<f:validator validatorId="validadorVacio"/>
</p:inputText>
<p:message for="txtIdentificador"/>
<p:outputLabel value="Nombre de combustible:" for="txtDescripcion"/>
<p:inputText id="txtDescripcion" label="Nombre" value="#{mbCombustibles.combustible.descripcion}">
<f:validator validatorId="validadorVacio"/>
</p:inputText>
<p:message for="txtDescripcion"/>
<p:commandButton value="Registrar Combustible" actionListener="#{mbCombustibles.registrar()}" update=":frmAltaCombustible,:frmListaCombustibles"/>
</p:panelGrid>
</p:dialog>
</h:form>
然後只是不更新包含表格的完整表格 – Kukeltje