【问题标题】:Primefaces dialog doesn't close the second timePrimefaces 对话框第二次没有关闭
【发布时间】:2013-06-03 15:31:04
【问题描述】:

我使用对话框来显示时事通讯。第一次,一切正常:弹出对话框,可以使用 X 和额外的按钮“关闭”关闭它

            <h:form id="frmDialog">
            <p:dialog header="...: NEWS :..."
                      widgetVar="widgetInfo" modal="true" dynamic="true"> 
                <p:commandButton  value="close" onclick="widgetInfo.hide();"/>
                <p:outputPanel id="pnlNewsLetter" style="width:610px;">                                        
                    <ui:include src="#{corporateManager.newsLetter}"/>
                </p:outputPanel>
            </p:dialog>
        </h:form>

.... 当我单击按钮重新打开同一个对话框时,它会打开,但无法关闭。而不是关闭,点击 X 按钮或“关闭”按钮,对话框的整个内容被选中并且页面变得无响应 .....

          <h:form>
            <h:commandButton  image="/newsletters/img/1karel.png" onclick="widgetInfo.show();">
            <f:ajax render=":frmDialog:pnlNewsLetter"/>
            <f:setPropertyActionListener value="/newsletters/2012-12-21.html" target="#{corporateManager.newsLetter}"/>
         </h:commandButton></h:form>

.....我尝试过使用 p:commandButton、使用 oncomplete()、closable="false"、使用 h:button、添加/删除表单标签或 id 等...

环境:Glasfish3.1.2 - Netbeans 7.3 - Primefaces 3.1 - Google Chrome 27.0.1453.94 m

【问题讨论】:

    标签: primefaces dialog


    【解决方案1】:

    感谢我昨天错过的另一个帖子:dialog will not close primefaces, 我已经更改了我的代码,它按预期运行,为每个按钮显示另一个时事通讯:

    <p:commandButton   oncomplete="widgetInfo.show();" value="" styleClass="karel4"
          update=":pnlNewsLetter">
     <f:setPropertyActionListener value="/newsletters/2013-03-19.html" target="#{corporateManager.newsLetter}"/>
    </p:commandButton>
    

    我不得不删除&lt;f:ajax render=":pnlNewsLetter"/&gt;,否则即使单击另一个按钮也会显示第一个时事通讯。 非常感谢!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-04
      • 1970-01-01
      • 2012-09-20
      相关资源
      最近更新 更多