title: Primefaces tabview tabChange event fired after displaying tab
body: <p>I am working on a project using Primefaces 3.5 &amp; JSF2.1 (Mojarra) </p>
  
  <p>I have created a primefaces <code>&lt;p:tabView id="tabsVw" dynamic="false"&gt;</code> with two tabs inside and each tab has a primefaces datatable </p>
  
  <pre><code> &lt;h:form&gt; 
          &lt;p:tabView  dynamic="false"&gt;
          &lt;p:ajax event="tabChange" listener="#{tstTab.onDtlTabChanged}" /&gt;
  
              &lt;p:tab title="tab1"&gt;
                  &lt;p:dataTable value="#{tstTab.list1}" var="v1"&gt;
                      &lt;p:column&gt;
                          &lt;h:outputText value="#{v1}"/&gt;
                      &lt;/p:column&gt;
                  &lt;/p:dataTable&gt;
              &lt;/p:tab&gt;
  
              &lt;p:tab title="tab2"&gt;
                  &lt;p:dataTable value="#{tstTab.list2}" var="v2"&gt;
                      &lt;p:column&gt;
                          &lt;h:outputText value="#{v2}"/&gt;
                      &lt;/p:column&gt;
                  &lt;/p:dataTable&gt;          
              &lt;/p:tab&gt;
          &lt;/p:tabView&gt;
      &lt;/h:form&gt;
  </code></pre>
  
  <p>and inside the bean (view scoped)</p>
  
  <pre><code>@ManagedBean
  @ViewScoped
  public class TstTab {
  
      private List&lt;String&gt; list1;
      private List&lt;String&gt; list2;
  
      public TstTab(){
          list1 = new ArrayList&lt;String&gt;();
          list2 = new ArrayList&lt;String&gt;();
  
  
          list1.add("List 1 - Str 1");
          list1.add("List 1 - Str 2");
          list1.add("List 1 - Str 3");
          list1.add("List 1 - Str 4");
          list1.add("List 1 - Str 5");
  
          list2.add("List 2 - Str 1");
          list2.add("List 2 - Str 2");
          list2.add("List 2 - Str 3");
          list2.add("List 2 - Str 4");
          list2.add("List 2 - Str 5");            
      }
  
  
      public void onDtlTabChanged(TabChangeEvent event) {
          System.out.println("000000000000000000");
      }
  
  
      public List&lt;String&gt; getList1() {
          System.out.println("11111111111111");
          return list1;
      }
  
  
      public List&lt;String&gt; getList2() {
          System.out.println("222222222222222222");
          return list2;
      }
  </code></pre>
  
  <p>}</p>
  
  <p>now the problem is when run the application and try to navigate (change) between tabs, but I can see that the <code>onDtlTabChanged</code> is called after calling getters, so that is a big problem.</p>
  
  <p>and if change the <code>tabView</code> from static to dynamic, then the behavior is random, in other words the calling to the change event is happening somewhere in the middle of getters.</p>
  
  <p>Thank you in advance.</p>