3 Replies Latest reply on Apr 30, 2009 7:39 PM by Nick Belaevski

    tabPanel Issue

    CG1 MT Newbie

      Hi,
      We have a simple rich:tabPanel with 3 tabs (using a4j:include). Unfortunately data for all 3 tabs is loaded on startup, on editing any table row and so on.

      ex:
      <rich:tabPanel id="tabs" switchType="ajax" selectedTab="t1">
      <rich:tab id="t1" label="T1">
      <a4j:include viewId="/M1List.xhtml"/>
      </rich:tab>
      <rich:tab id="t2" label="T2">
      <a4j:include viewId="/M2List.xhtml"/>
      </rich:tab>
      <rich:tab id="t3" label="T3">
      <a4j:include viewId="/M3List.xhtml"/>
      </rich:tab>

      </rich:tabPanel>

      Is there any way to prevent this? This seems to be a real show stopper?

      Thanks for your support
      Ganesh

        • 1. Re: tabPanel Issue
          Nick Belaevski Master

          Hello Ganesh,

          a4j:include creates components tree for all tabs, not just for the one being rendered. You can work around that by making dynamic viewId:

          viewId="#{bean.viewId}"
          and refer to the blank views for tabs that are not the current one.

          • 2. Re: tabPanel Issue
            CG1 MT Newbie

            Thanks for this response...

            But at some point if the user clicks the second tab, then viewId of first tab will have to be reset. This means if the user clicks the first tab after clicking the other tabs, data will have to be refetched.

            Is there no other way to have dynamic tab content?

            Thanks
            Ganesh

            • 3. Re: tabPanel Issue
              Nick Belaevski Master

              You can make client-mode tabs empty by default and use a4j:support that will track tabs switches and load data.