Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/387.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Primefaces重叠面板:“Primefaces overlay panel”;showCloseIcon“;它不起作用了_Java_Jsf_Primefaces - Fatal编程技术网

Java Primefaces重叠面板:“Primefaces overlay panel”;showCloseIcon“;它不起作用了

Java Primefaces重叠面板:“Primefaces overlay panel”;showCloseIcon“;它不起作用了,java,jsf,primefaces,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

您好,我正在使用覆盖面板显示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>

您的浏览器无法显示pdf,请单击下载pdf。

我尝试使用dismissable,但它不起作用。有人能帮忙吗

我不知道您正在使用哪个版本的PrimeFaces,但根据以下代码,它应该可以工作:



“pdf仍然打开”是什么意思?覆盖面板根本没有消失,是吗?

我知道已经太晚了,但今天我遇到了这个问题,我可以解决它,所以也许它可以帮助其他人


这可能是jQuery的问题。如果使用Bootstrap,您将导入jQuery,但PrimeFaces包含jQuery,因此存在jQuery版本冲突。删除引导jQuery并使用其中一个PrimeFaces。它对我起了作用。

是的,pdf仍然打开。我正在使用PrimeFaces4.0。我认为是javascript库导致了这个问题。是的,我查看了PF 4.0文档。你的代码看起来不错。似乎是别的东西而不是PrimeFaces引起了麻烦。你能提供你的整个页面吗?
  <p:overlayPanel id="viewPanel" for="viewBtn" hideEffect="explode" dynamic="true" dismissable="false" showCloseIcon="true">
        <!-- content goes here -->
  </p:overlayPanel>