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