为什么overlayPanel会在hide上刷新整个页面

时间:2016-12-29 17:19:50

标签: jsf primefaces

我正在使用overlayPanel和一个按钮来隐藏它但按下按钮时整个页面都会刷新..这就是代码

<h:form id="editForm"> 
    <a href="#" class="dropdown-toggle thumbnail" data-toggle="dropdown">
         <p:graphicImage  value="ImageLoaderServlet?emp=employer&amp;emp_id=#{userBean.current_user.user_id}" cache="false" />
    </a>

    <ul class="dropdown-menu">
        <li><p:commandLink id="editEmp" value="Edit Profile" type="button" /></li>

        <li class="divider"></li>
        <li><h:commandLink id="logout" action="#{userBean.logout()}" >LogOut</h:commandLink></li>            
   </ul> 
</h:form> 
<h:form>
    <p:overlayPanel id="editPanel" widgetVar="ovl" showCloseIcon="true" dynamic="true" for="editForm:editEmp" showEffect="blind" hideEffect="explode"  style="width:300px;margin-top: 100px">
         <p:commandButton value="Close"  onclick="ovl.hide();" update="@this"/>
     </p:overlayPanel>
</h:form>

我添加了showCloseIcon =&#34; true&#34;但是从不工作..如果不使用按钮关闭页面刷新,我该怎么做才能隐藏叠加层 谢谢

1 个答案:

答案 0 :(得分:0)

问题通过从页面中删除此文件 jquery-1.11.0.min.js 来解决,因为它导致与primefaces JavaScript发生冲突。 谢谢你@Kukeltje的帮助