2013-08-21 28 views
0

我有一個網頁註銷按鈕,這是h前:commandLinkH:commandLink refershes頁面調用動作

<h:form> 
       <div id="top-nav"> 
        <div id="logout" style="float: right; margin-left: 10px;"> 

         <h:commandLink styleClass="top-nav-btn" 
          action="#{adminLogoutBean.logout}" 
          rendered="#{facesContext.externalContext.sessionMap['ccUserVO'] ne null}" value="Logout" immediate="true"> 
          <f:ajax execute="@form" render="@none" /> 
          </h:commandLink> 


        </div> 


         <div style="margin-left: -80px; margin-top: 70px;"> 
          <p style="float: left;margin-left: 10px;">Please 
           enter client VIN or EMAIL</p> 
          <br /> 
          <h:inputText styleClass="menus txfld_border_no_image required email" 
           minlength="5" style="width:300px;clear:right;display:inline;" 
           id="loginEmail" value="#{callCenterAdminBean.searchText}" /> 
          <span class="btn-wrap" id="get_enabled"> <h:commandButton type="submit" 
            class="common_btn noprint submit" id="userlookup_btn" value="GET" 
            action="#{callCenterAdminBean.userLookup}"> 

           </h:commandButton> </span> 
          <span class="btn-wrap" id="get_disabled" style="display:none"> <h:commandButton type="submit" 
            class="common_btn noprint submit" disabled='true' value="GET" 
            action="#{callCenterAdminBean.userLookup}"> 

          </h:commandButton> </span> 
         </div> 
        </h:panelGroup> 
       </div> 

      </h:form> 

當我點擊退出,我找到了頁面刷新,然後再行動是調用。爲什麼頁面刷新?我想調用bean方法,它將使用導航規則重定向到登錄頁面。

請幫忙。

回答

0

如果你想使用你不需要的AJAX導航,只是刪除

<f:ajax execute="@form" render="@none" /> 

,並清除immediate="true"因爲我看不出有任何理由讓你在下面的使用方式,因此案例...