Primefaces覆盖面板:" showCloseIcon"不管用

时间:2014-05-13 10:15:48

标签: java jsf primefaces

您好我正在使用叠加面板来显示PDF。当我单击关闭按钮时,PDF仍处于打开状态。这是我的代码:

    <p:commandButton id="view" value="View" type="button" />

      <p:overlayPanel id="pdf" for="view" hideEffect="Explode"  dynamic="true" showCloseIcon="true"  >
            <p:media value="/file/sample.pdf" player="pdf"> 
                    Your browser can't display pdf,<h:outputLink value="/file/Payslip_User_Guide.pdf">Click</h:outputLink> to download PDF.
            </p:media>
      </p:overlayPanel>

我尝试使用可解雇的,但它不起作用。有人可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

我不知道您使用的是哪个版本的PrimeFaces,但根据PrimeFaces 5.0 showcase,以下代码应该有效:

  <p:overlayPanel id="viewPanel" for="viewBtn" hideEffect="explode" dynamic="true" dismissable="false" showCloseIcon="true">
        <!-- content goes here -->
  </p:overlayPanel>

“pdf仍然开放”是什么意思? overlayPanel根本不会消失,是吗?