2 Replies Latest reply on Apr 30, 2008 9:33 AM by Matthew Hibberd

    rich:tab action question

    Matthew Hibberd Newbie

      Hi All,

      I have a page with the following tabbed view:

      <rich:tabPanel>
       <rich:tab label="One" action="#{bean1.fetchData}">
       <h:outputText value="#{bean1.showSomeData}"/>
       </rich:tab>
       <rich:tab label="Two" action="#{bean2.fetchData}">
       <h:outputText value="#{bean2.showSomeData}"/>
       </rich:tab>
      </rich:tabPanel>
      


      The problem I'm having is that tab "One" is shown initially, but fetchData is not called on bean1. Therefore when tab "One" initially displays, the data in bean1 hasn't been populated and I'm not showing any data. After the initial page load, clicking the tabs works as I expected.

      Couple of questions:
      1. Am I missing something obvious? Is there a way to force a call to action on the default tab when the page is initially loaded?
      2. Does anyone think I've got the wrong idea trying to load tab data like this, as I only started with JSF a couple of days ago ;)

      Thanks in advance