1 Reply Latest reply on Oct 14, 2008 1:45 PM by ilya_shaikovsky

    tabPanel current tab refreshed before newly selected one pai

    achildress

      It seems that a tabPanel's currently displayed tab is refreshed/repainted before a newly selected tab is displayed/painted. Is this the correct behavior? It is causing me much grief. I don't want the currently selected tab to repaint (thus causing all kinds of requests to the server to retrieve data for a tab that will untimately go away) just because I clicked on a new tab to be shown. For example, in the tabPanel below, if I click on the family tab (which should basically display a blank facelet page in the tab), the identification tab is refreshed first (I know this because the getBirthDateCommentsPresent method of TestOffenderBean is fired):

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:c="http://java.sun.com/jstl/core"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich">
       <h:form id="interviewform">
       <rich:tabPanel id="admintechinterviewtabs" switchType="ajax" style="width: 98%;">
       <rich:tab id="identification" label="Identification">
       <ui:include src="\testinterviewidentification.xhtml"/>
       </rich:tab>
       <rich:tab id="family" label="Family">
       <ui:include src="\blankpage.xhtml"/>
       </rich:tab>
       </rich:tabPanel>
       </h:form>
      </ui:composition>
      


      Code for testinterviewidentification.xhtml:

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich">
       <a4j:outputPanel id="birthdtcomm">
       <a4j:commandButton rendered="#{!TestOffenderBean.birthDateCommentsPresent}" image="/images/documentempty.gif" actionListener="#{DOPIntakeAdminTechInterviewBean.newBirthDateComment}" oncomplete="javascript:Richfaces.showModalPanel('genericmp',{width:500, height: 340, top:200});"/>
       <a4j:commandButton rendered="#{TestOffenderBean.birthDateCommentsPresent}" image="/images/documentpresent.gif" actionListener="#{DOPIntakeAdminTechInterviewBean.selectBirthDateComment}" oncomplete="javascript:Richfaces.showModalPanel('genericmp',{width:500, height: 340, top:200});"/>
       </a4j:outputPanel>
      </ui:composition>
      


      This seems to happen when switchType is either ajax or server, but not when switchType is client. Can anybody explain this behavior please? I really need the switchType to be ajax for several business reasons.