title: How to stay on the same tab after submitting a form
body: <p>I am using p:tab view like this</p>
  
  <pre><code>&lt;ui:composition template="./WEB-INF/templates/masterTemplate.xhtml"&gt;
      &lt;ui:define name="windowTitle"&gt;
          #{msgs.home}
      &lt;/ui:define&gt;
  
      &lt;ui:define name="content"&gt;
          &lt;p:tabView id="tabView" dynamic="false"&gt;
  
              &lt;p:tab id="tab1" title="#{msgs.home}"&gt;
                  &lt;ui:include src="/homePages/home.xhtml" /&gt;
              &lt;/p:tab&gt; &lt;!--end of tab1 --&gt;
  
              &lt;p:tab id="tab2" title="#{msgs.join}"&gt;
                  &lt;ui:include src="/homePages/join.xhtml" /&gt;
              &lt;/p:tab&gt; &lt;!--end of tab2 --&gt;
  
              &lt;p:tab id="tab3" title="#{msgs.signIn}"&gt;
                  &lt;ui:include src="/homePages/login.xhtml" /&gt;
              &lt;/p:tab&gt; &lt;!--end of tab3 --&gt;
  
          &lt;/p:tabView&gt;
      &lt;/ui:define&gt;
  &lt;/ui:composition&gt;
  </code></pre>
  
  <p>Here is my join.xhtml page</p>
  
  <pre><code>&lt;h:body&gt;
      &lt;ui:composition&gt;
          &lt;div id="join" style="border-style:solid; border-width:5px; padding: 10px;" &gt;
              &lt;div id="joinFormPosition" class="left"&gt;
                  &lt;h:form id="joinForm"&gt;
                      &lt;h:outputText id="joinMessgae" value="#{msgs.joinMessgae}" /&gt;
                      &lt;span class="asterisk"&gt;*&lt;/span&gt;&lt;span class="labels"&gt;#{msgs.signInName}: &lt;/span&gt;
                      &lt;p:inputText id="name"
                                   value="#{joinPage.signInName}"
                                   required="true"/&gt;
                      &lt;p:message for="name" /&gt;
                      ...
  
                      &lt;div id="submitButton"&gt;
                          &lt;h:commandButton id="submitBtn"
                                           value="Submit"
                                           actionListener="#{join.saveUser}" /&gt;
                      &lt;/div&gt;
                  &lt;/h:form&gt;
              &lt;/div&gt; &lt;!--end of joinFormPosition  --&gt;
          &lt;/div&gt; &lt;!--end of join  --&gt;
      &lt;/ui:composition&gt;
  &lt;/h:body&gt;
  </code></pre>
  
  <p>login.xhtml</p>
  
  <pre><code>&lt;ui:composition&gt;
  
          &lt;div id="login" style="border-style:solid; border-width:5px; padding: 10px;" &gt;
  
              &lt;div id="loginFormPosition" class="left"&gt;
  
                  &lt;h:form id="loginForm"&gt;
                      &lt;h:outputText value="#{msgs.signIn}" /&gt;
                      .....
                      &lt;div id="signInButton"&gt;
                          &lt;h:commandButton id="signInBtn"
                                           value="Submit"
                                           actionListener="#{login.signIn}"
                                           action ="#{login.outcome}"/&gt;
                      &lt;/div&gt;
                  &lt;/h:form&gt;
              &lt;/div&gt; &lt;!--end of loginFormPosition  --&gt;
          &lt;/div&gt; &lt;!--end of login --&gt;
      &lt;/ui:composition&gt;
  </code></pre>
  
  <p>IF i am on tab join and then submit the form and if any validation fails, then i switch to first tab. I want that if i click on the submit button and whether validation fails or not i stay on the same tab. The same situation i am facing on the login tab. How can i stay on the same tab after submitting the form?</p>
  
  <p>Thanks</p>