更新<;p:dialog>;每当在PrimeFaces中打开“新建”对话框时

更新<;p:dialog>;每当在PrimeFaces中打开“新建”对话框时,primefaces,Primefaces,它始终显示以前的值,而不是新值 <p:panel id="instantTransPanel" header="Quick Transfer (To Beneficiary)" toggleable="true" closable="false" toggleSpeed="500" closeSpeed="500" widgetVar="instantTransPanelVar" rendered="#{userMBean.loggedOnUser.customer.customerTyp

它始终显示以前的值,而不是新值

<p:panel id="instantTransPanel" header="Quick Transfer (To Beneficiary)" toggleable="true" closable="false" toggleSpeed="500" closeSpeed="500" widgetVar="instantTransPanelVar"
rendered="#{userMBean.loggedOnUser.customer.customerType != constantuserMBean.getFETSTYPE() and (userMBean.loggedOnUser.customer.customerType != constantuserMBean.getMERCHANTTYPE() or (userMBean.loggedOnUser.customer.customerType == constantuserMBean.getMERCHANTTYPE() and userMBean.loggedOnUser.customer.hasCustomerCapability))}">
                <p:commandButton value="Add New Beneficiary" onclick="addBendlg.show();" />
                <br/><br/>
                <p:dataTable id="beneficiariesTable" var="obj" value="#{userMBean.loggedOnUser.customer.customerBeneficiaryList}"
                    paginator="true" rows="20"
                    paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                    rowsPerPageTemplate="20,50,100" style="width:100%" resizableColumns="true">

                    <p:column sortBy="#{obj.beneficiaryMsisdn}" headerText="Mobile Number" filterBy="#{obj.beneficiaryMsisdn}" filterMatchMode="contains">
                        <h:outputText value="#{obj.beneficiaryMsisdn}" />
                    </p:column>
                    <p:column sortBy="#{obj.beneficiaryName}" headerText="Name" filterBy="#{obj.beneficiaryName}" filterMatchMode="contains">
                        <h:outputText value="#{obj.beneficiaryName}" />
                    </p:column>
                    <p:column sortBy="#{obj.crt_dt}" headerText="Date Added">
                        <h:outputText value="#{obj.crt_dt}" />
                    </p:column>
                    <p:column headerText="Transfer">
                        <p:commandButton value="Transfer" update=":form:transferBenPanel" action="#{engineMBean.initTransfer(obj.beneficiaryMsisdn, obj.beneficiaryName)}" oncomplete="transferToBendlg.show();" />
                    </p:column>
                    <p:column headerText="Delete">
                        <p:commandButton ajax="false" onclick="return confirm('Are you sure?');" action="#{userMBean.deleteBeneficiary(obj.beneficiaryMsisdn)}" icon="ui-icon-close" style="margin:0"/>
                    </p:column>
                </p:dataTable>
            </p:panel>



之后,它调用对话框,第一次正常工作,但下一次我想要输入另一个值时,单击后,它会弹出旧值

<p:dialog id="addBenDialog" header="Add Beneficiary" widgetVar="addBendlg" modal="true" dynamic="true" position="center">
        <p:panelGrid columns="2" cellpadding="5" style="margin-bottom:10px;">
        <f:facet name="header"></f:facet>

        <h:outputLabel for="bmsisdn" value="Beneficiary Mobile Number: *" />
        <p:inputText id="bmsisdn" value="#{userMBean.beneficiary.beneficiaryMsisdn}">
            <p:ajax update="bname" />
        </p:inputText>

        <h:outputLabel for="bname" value="Beneficiary Name: " />
        <h:outputText id="bname" value="#{userMBean.lookUpBeneficiaryName(userMBean.beneficiary.beneficiaryMsisdn)}" />

        <f:facet name="footer">
            <p:commandButton ajax="false" onclick="return confirm('Are you sure?');" action="#{userMBean.addBeneficiary}" value="Save" icon="ui-icon-disk" style="margin:0"/>
        </f:facet>

        </p:panelGrid>
    </p:dialog>

您需要在对话框显示之前更新它

将代码更改为:

<p:commandButton value="Add New Beneficiary" onComplete="addBendlg.show(); update=:form:addBenDialog" />

当我单击按钮时,不会显示对话框,只是再次刷新页面。请建议我