Primefaces Dialog 未在第二次视图中重置选定值
Primefaces Dialog is not resetting selected values on second time view
我的 xhtml 中有一个 dataTable
将显示记录,在 dataTable
的最后一列中,我有一个 commandButton
将显示一个对话框有一个 selectOneMenu,用户可以 select 日期并根据日期 selection,值将打印在 outputText
字段中。密码是:
<h:form id="f1">
<p:dataTable id="Requests">
<p:commandButton id="View" update=":BankSearchForm:tab1:#{c.dialogueName}"
oncomplete="PF('#{c.certificateDialogue}').show()" title="View">
<f:setPropertyActionListener value="#{c}" target="#{bcd.selectedRequest}"/>
</p:commandButton>
</p:dataTable>
<p:dialog header="SSA" widgetVar="SSDialog" modal="true" showEffect="fade"
hideEffect="fade" resizable="false" width="1200px">
<p:outputPanel id="BSSEN" style="text-align:center;" autoUpdate="true">
<p:selectOneMenu id="SelectMonth" value="#{bcd.selectedMonth}">
<p:ajax event="change" listener="#{bcd.BSSCert}"/>
<f:selectItems label="#{bcd.coffee2Value}" value="#{bcd.coffee2Value}"/>
</p:selectOneMenu>
</p:outputPanel>
</h:form>
第一次单击 commandButton
时,将显示对话框,我可以 select 来自 selectOneMenu
的任何值,当我关闭 dialog
并再次单击 commandButton
,较早的 selected 值将再次显示在应重置为默认值且 outputLabels 应为空白的位置。那么我该如何实现呢?
显示对话框时更新对话框面板。
<p:commandButton id="View" update="BSSEN :BankSearchForm:tab1:#{c.dialogueName}"
我的 xhtml 中有一个 dataTable
将显示记录,在 dataTable
的最后一列中,我有一个 commandButton
将显示一个对话框有一个 selectOneMenu,用户可以 select 日期并根据日期 selection,值将打印在 outputText
字段中。密码是:
<h:form id="f1">
<p:dataTable id="Requests">
<p:commandButton id="View" update=":BankSearchForm:tab1:#{c.dialogueName}"
oncomplete="PF('#{c.certificateDialogue}').show()" title="View">
<f:setPropertyActionListener value="#{c}" target="#{bcd.selectedRequest}"/>
</p:commandButton>
</p:dataTable>
<p:dialog header="SSA" widgetVar="SSDialog" modal="true" showEffect="fade"
hideEffect="fade" resizable="false" width="1200px">
<p:outputPanel id="BSSEN" style="text-align:center;" autoUpdate="true">
<p:selectOneMenu id="SelectMonth" value="#{bcd.selectedMonth}">
<p:ajax event="change" listener="#{bcd.BSSCert}"/>
<f:selectItems label="#{bcd.coffee2Value}" value="#{bcd.coffee2Value}"/>
</p:selectOneMenu>
</p:outputPanel>
</h:form>
第一次单击 commandButton
时,将显示对话框,我可以 select 来自 selectOneMenu
的任何值,当我关闭 dialog
并再次单击 commandButton
,较早的 selected 值将再次显示在应重置为默认值且 outputLabels 应为空白的位置。那么我该如何实现呢?
显示对话框时更新对话框面板。
<p:commandButton id="View" update="BSSEN :BankSearchForm:tab1:#{c.dialogueName}"