在菜单项上更新后,"oncomplete"未显示Primefaces对话框



我有这段代码:

<h:body>
  <h:form id="form1">
     <p:menuButton value="#{msgs.settingsMenuButton}">
        <p:menuitem value="#{msgs.accountsMenuItem}" url="#" update=":dlgEdit" oncomplete="_dlgEdit.show()"/>  
      </p:menuButton>  
      <p:commandButton value="Accounts" icon="ui-icon-gear" 
                        update=":dlgEdit"
                        oncomplete="_dlgEdit.show()"/>
   </h:form>
   <p:dialog id="dlgEdit" widgetVar="_dlgEdit" modal="true" closable="true" header="Accounts">  
       <h:form id="frmEdit" >
           <p:panelGrid id="pnlEdit" columns="2">
               <p:outputLabel id="lblName" for="eName" value="Name"/>
               <p:inputText id="eName" value="#{tasksBean.selectedLocation}"/>
           </p:panelGrid>
       </h:form>
   </p:dialog>  
</h:body>

选择菜单项时不显示该对话框,但在按下命令按钮时该对话框有效。两者的行为是相同的...

你能支持我吗?

谢谢安德烈

尝试:

oncomplete="PF('_dlgEdit').show();"

最新更新