0 Replies Latest reply on Mar 25, 2008 2:28 PM by srinivasan muthu

    Tab panel remembering the selected tab

    srinivasan muthu Newbie

      I use JBoss Seam, RichFaces 3.1.4.GA

      I have a simple page where i have 2 links (Report1, Report2) and a Tab Panel (dynamic tabs).

      When user clicks on Report1, the Tab Panel will show certain number of tabs based on the number of reports from the backing bean (ScopeType.PAGE).

      When user clicks on Report2, the Tab Panel will show a different sets of reports meaning different number of tabs.

      The problem is
      1) when user clicks on Report1 link
      2) 3 tabs appear
      3) lets say user selects the 3rd tab
      4) user clicks on Report2 link
      5) 5 tabs appear BUT NOW WITH the 3rd tab selected.

      I believe the this is because the viewstate still remembers the 3rd tab selection for the Tab Panel.

      How do I force a refresh of tab panel when ever the link is clicked (instead of the ajax)?

      Here is my code:
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"

      <h:messages styleClass="message"/>

      <h:form id="reportForm">


      <a4j:commandLink id="id1" value="Report1" ajaxSingle="true" reRender="reportPanel">
      <a4j:actionparam name="reportId"
      value="4" />

      <a4j:commandLink id="id2" value="Report2" ajaxSingle="true" reRender="reportPanel">
      <a4j:actionparam name="reportId"
      value="5" />

      <a4j:outputPanel id="reportPanel">

      <rich:tabPanel switchType="ajax" selectedTab=">

      <c:forEach items="#{reportCardTree.selectedReportCardNode.reports}" var="report" varStatus="stat">
      <rich:tab label="#{report.title}">

      <rich:panel style="width:100%">