我使用overlayPanel一個按鈕來隱藏它的整個頁面,但按下按鈕時,整個頁面刷新..這是代碼爲什麼overlayPanel刷新上隱藏
<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>
我加showCloseIcon =「真「但從來沒有工作..我應該做的使用按鈕關閉 隱藏不刷新頁面覆蓋謝謝
開始**不使用嵌套窗體(你今天是第四個)http://stackoverflow.com/questions/7371903/how-to-use-hform-in-jsf-page- single-form-multiple-forms-nested-forms – Kukeltje
我編輯了我的代碼,如編輯後的問題所示,但得到同樣的問題。頁面關閉時刷新@Kukeltje –
關閉命令按鈕很奇怪。你不需要調用任何服務器端,更新'@this'並使用onclick。爲什麼不cgange使用'type =「按鈕」'(如果我沒有記錯的話,它在commandLink上是沒用的 – Kukeltje