title: Is there a simple way to navigate between tabs of tabview with primefaces without using wizard?
body: <p>I am trying to do a page with 3 tabs and I want user to navigate between tabs by "next" and "back" buttons without using wizard. But user cannot navigate after second tab. Where is the mistake I could not find?
  Here is my html code:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8' ?&gt;
      &lt;!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
      &lt;ui:composition xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:p="http://primefaces.org/ui"
          xmlns:c="http://java.sun.com/jsp/jstl/core"
          template="template/template.xhtml"&gt;
  
          &lt;ui:define name="body"&gt;
  
          &lt;h:form  prependId="false" id="form"&gt;
          &lt;p:tabView id="tabPanel" widgetVar="tabPanel" binding="#{myBean.tabView}" dynamic="true"&gt;
  
          &lt;!-- FIRST TAB --&gt;
                  &lt;p:tab id="person" title="Person"&gt;
                      &lt;h:panelGrid columns="2" cellpadding="10"&gt;              
                       &lt;h:outputText value="name" /&gt;
                       &lt;p:inputText value="#{myBean.user.firstname}" label="Name" &lt;/p:inputText&gt; 
      &lt;p:commandButton  value="NEXT" action="#{myBean.nextButton}" update=":form:tabPanel" immediate="true"/&gt;
                 &lt;/h:panelGrid&gt;
      &lt;/p:tab&gt;                     
  
   &lt;!-- SECOND TAB --&gt;
                  &lt;p:tab id="adres" title="Address"&gt;
                      &lt;h:panelGrid columns="2" cellpadding="10"&gt;
                        &lt;h:outputText value="Phone" /&gt;
                        &lt;p:inputMask id="phone" value="#{myBean.user.phone}" mask="1999999999" required="true" requiredMessage="ERROR AT PHONE NUMBER"/&gt;
      &lt;p:commandButton  value="NEXT" action="#{myBean.nextButton2}" update=":form:tabPanel" immediate="true"/&gt;
    &lt;/h:panelGrid&gt;
      &lt;/p:tab&gt;
  
                  &lt;!-- THIRD TAB --&gt;
                  &lt;p:tab title="Contact"&gt;
                      &lt;h:panelGrid columns="2" cellpadding="10"&gt;
  
                      &lt;/h:panelGrid&gt;
                  &lt;/p:tab&gt;             
  
              &lt;/p:tabView&gt;
          &lt;/h:form&gt;      
          &lt;/ui:define&gt;    
          &lt;/ui:composition&gt;
  </code></pre>
  
  <p>And Here is my myBean:</p>
  
  <pre><code>@ManagedBean(name = "myBean") 
  @ViewScoped 
  public class MyBean implements Serializable {
  
  private User user = new User(); 
  
   private TabView tabView;
  
      public TabView getTabView() {
          return tabView;
      }
  
      public void setTabView(TabView tabView) {
        this.tabView = tabView;
      }
  
      public void nextButton()
      {
          tabView.setActiveIndex(1);
      }
  
      public void nextButton2()
      {
          tabView.setActiveIndex(2);
      }
  }
  </code></pre>