title: Primefaces tabView activeIndex property is always getting null
body: <p>Primefaces tabView activeIndex property  is always getting null.</p>
  
  <p>My view.jsf:</p>
  
  <pre><code>&lt;h:form&gt;
  &lt;p:growl id="growl" showDetail="true" /&gt;
  &lt;p:tabView &gt;
  &lt;p:ajax event="myForm" listener="#{employeeEdit.onTabChange}" /&gt; 
  &lt;p:tab id="basic" title="Login"&gt;
  &lt;/p:tab&gt;
  &lt;p:tab id="personal" title="Personal"&gt;
  &lt;/p:tab&gt;
  &lt;p:tab id="contact" title="Contact"&gt;
  &lt;/p:tab&gt;
  &lt;/p:tabView&gt;
  </code></pre>
  
  <p>My edit.jsf:</p>
  
  <pre><code>&lt;h:form prependId="false" &gt;
  &lt;p:tabView id="myid" activeIndex="#{employeeEdit.tabIndex}" &gt;
  &lt;p:tab id="basic" title="Login"&gt;
  &lt;/p:tab&gt;
  &lt;p:tab id="personal" title="Personal"&gt;
  &lt;/p:tab&gt;
  &lt;p:tab id="contact" title="Contact"&gt;
  &lt;/p:tab&gt;
  &lt;/p:tabView&gt;
  </code></pre>
  
  <p>Backing bean:
  EmployeeEdit.java:</p>
  
  <pre><code>@Component("employeeEdit")
  @ViewScoped
  @Repository
  public class EmployeeEdit implements Serializable{
  
      /**
       * 
       */
      private static final long serialVersionUID = -2784529548783517864L;
      private EmployeeDTO employeeDTO = new EmployeeDTO();
      public static HibernateTemplate hibernateTemplate;
      private int tabIndex;   
  
      @Autowired
      public void setSessionFactory(SessionFactory sessionFactory)
      {
          System.out.println("in SessionFactory" +sessionFactory);
          this.hibernateTemplate = new HibernateTemplate(sessionFactory);
          System.out.println("in SessionFactory" +hibernateTemplate);
  
      }
  
  
      public int onTabChange(TabChangeEvent event) {   
  
          System.out.println("tab id = " + event.getTab().getId()+event.getTab().getTitle());
          if(event.getTab().getId().equals("personal"))
          {
              tabIndex =0;
          }
          else if(event.getTab().getId().equals("address"))
          {
              tabIndex =1;
          }
          else
          {
              tabIndex =2;
          }
          System.out.println("tabIndex = "+tabIndex);
          return tabIndex;
      }
  
  
  
      public void edit() throws IOException
      {
  
          FacesContext.getCurrentInstance().getExternalContext().redirect("/employeeedit.jsf");
      }
  
  
  
      public void cancel() throws IOException
      {
          FacesContext.getCurrentInstance().getExternalContext().redirect("/employeelist.jsf");
      }
  
      public EmployeeDTO getEmployeeDTO() {
          return employeeDTO;
      }
  
      public void setEmployeeDTO(EmployeeDTO employeeDTO) {
          this.employeeDTO = employeeDTO;
      }
  
      public int getTabIndex() {
          return tabIndex;
      }
  
      public void setTabIndex(int tabIndex) {
          this.tabIndex = tabIndex;
      }
  }
  </code></pre>
  
  <p>But always getting tabIndex=0; Why this happening? The AJAX is working fine. But on clicking the Edit button in the view page tabIndex is getting null.
  in view.jsf, my command button is </p>
  
  <pre><code>&lt;p:commandButton value="Edit" actionListener="#{employeeEdit.edit}" /&gt;
  </code></pre>
  
  <p><strong>My primefaces version is: primefaces-3.0.M3 with Google Cloud SQL</strong></p>