【问题标题】:Primefaces dialog not shown at "oncomplete" after update on MenuItem更新 MenuItem 后,Primefaces 对话框未在“完成”时显示
【发布时间】:2014-01-16 07:45:02
【问题描述】:

我有这段代码:

<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>

选择 menuItem 时对话框不显示,但按下 commandButton 时对话框有效。 两者的行为是相同的......

你能支持我吗?

谢谢, 安德烈

【问题讨论】:

  • 我不确定它是如何工作的,但是在您的 p:dialog 中设置属性 appendToBody = true 可能会对您有所帮助

标签: primefaces dialog menuitem commandbutton


【解决方案1】:

试试:

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

【讨论】:

    猜你喜欢
    • 2013-06-28
    • 1970-01-01
    • 2017-02-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多