0

I am using overlayPanel with a button to hide it but when pressing the button the whole page refreshes .. this is the code

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

I added showCloseIcon="true" but never work .. What should i do to hide overlay without page refresh using button close thank you

m 1987
  • 153
  • 2
  • 14
  • Start by **not** using nested forms (you are the fourth today) http://stackoverflow.com/questions/7371903/how-to-use-hform-in-jsf-page-single-form-multiple-forms-nested-forms – Kukeltje Dec 29 '16 at 17:25
  • I've edited my code as shown in the edited question but got the same problem .. the page refreshes on close @Kukeltje – m 1987 Dec 29 '16 at 17:48
  • The close commandButton is strange. You don't call anything server side, update '@this' and use onclick. Why not cgange to using `type="button"` (which on the commandLink is useless if I remember correctly – Kukeltje Dec 29 '16 at 19:23
  • Sorry @Kukeltje .. i used this file jquery-1.11.0.min.js and it caused this problem – m 1987 Dec 29 '16 at 23:59

1 Answers1

0

The problem Solved by removing this file jquery-1.11.0.min.js from the page because it caused a conflict with primefaces JavaScript .. thank you @Kukeltje for your help

m 1987
  • 153
  • 2
  • 14
  • See, therefore ALLWAYS create a [mcve], now it was a ghostchase. And there most likely were errors in the console – Kukeltje Dec 30 '16 at 05:41
  • sorry for that @Kukeltje ... I didn't got the solution because every thing was running as expected and there was no conflict issues ... i agree with you that was a misleading question . – m 1987 Dec 30 '16 at 15:17