title: PrimeFaces button in Tab Doesn't Navigate
body: <p>I'm developing this project using JSF 2.0, NetBeans 6.9.1, GlassFish 3.1, Mojarra 2.0.3, and PrimeFaces 2.2-RC2.</p>
  
  <p>My question is similar to <a href="https://stackoverflow.com/questions/4639205/primefaces-commandbutton-doesnt-navigate-or-update">this question</a>, but even though I was able to make one of my buttons work, the other one does not.  Here's my situation: I have a dataTable with a column containing two links, one to edit line data, one to view line data.  Clicking either the "Edit" or "View" link takes you to a detail page with <code>&lt;h:panelGrid&gt;</code> components inside <code>&lt;p:tabView&gt;</code> components. My detail page has two <code>&lt;p:tabView&gt;</code> components, one for editing, one for just viewing data. Which one you see depends on the <code>&lt;c:if&gt;</code> statements.  The button in the first <code>&lt;p:tabView&gt;</code> on the page (by that I mean first working your way down from the top) works as I would like it to, this happens to be the "Edit" component. The button in the other <code>&lt;p:tabView&gt;</code> does not work. I set up break points and went through the debugger, the second button doesn't seem to fire an ActionEvent regardless of what I try. Here's my code for the page:</p>
  
  <pre><code>            &lt;ui:define name="metadata"&gt;
                  &lt;f:metadata&gt;
                      &lt;f:viewParam name="id" value="#{userDetailBean.selectedUserId}" /&gt;
                      &lt;f:viewParam name="action" value="#{userDetailBean.view}" /&gt;
                  &lt;/f:metadata&gt;
  
  
              &lt;/ui:define&gt;
  
  
              &lt;ui:define name="main_base_content_top"&gt;
                  &lt;h:form&gt;
                      &lt;p:toolbar&gt;
                          &lt;p:toolbarGroup align="left"&gt;
                              &lt;h:commandButton value="Return to User List" action="user_grid" /&gt;
                          &lt;/p:toolbarGroup&gt;
                      &lt;/p:toolbar&gt;
                  &lt;/h:form&gt;
              &lt;/ui:define&gt;
  
              &lt;ui:define name="main_base_content"&gt;
  
                      &lt;c:if test="#{empty userDetailBean.view}"&gt;
                          &lt;h:form&gt;
                          &lt;table align="center"&gt;
                              &lt;tr&gt;
                                  &lt;td&gt;
                                      &lt;p:tabView&gt;
                                          &lt;p:tab title="#{msgs.UserDetailTabTitle}"&gt;
                                              &lt;h:panelGrid columns="4"&gt;
                                                  &lt;h:outputLabel value="#{msgs.UserDetailFirstName}" for="fname" /&gt;
                                                  &lt;h:inputText id="fname" value="#{userDetailBean.firstName}" /&gt;
                                                  &lt;h:outputLabel value="#{msgs.UserDetailJobTitle}" for="jtitle" /&gt;
                                                  &lt;h:inputText id="jtitle" value="#{userDetailBean.jobTitle}" /&gt;
                                                  &lt;h:outputLabel value="#{msgs.UserDetailLastName}" for="lname" /&gt;
                                                  &lt;h:inputText id="lname" value="#{userDetailBean.lastName}" /&gt;
                                                  &lt;h:outputLabel value="#{msgs.UserDetailEmployeeId}" for="empid" /&gt;
                                                  &lt;h:inputText id="empid" value="#{userDetailBean.id}" /&gt;
                                                  &lt;h:outputLabel value="#{msgs.UserDetailDateOfHire}" for="doh" /&gt;
                                                  &lt;h:inputText id="doh" value="#{userDetailBean.DOH}" /&gt;
                                                  &lt;h:outputLabel value="#{msgs.UserDetailLocation}" for="location" /&gt;
                                                  &lt;h:inputText id="location" value="#{userDetailBean.location}" /&gt;
                                                  &lt;h:outputLabel value="#{msgs.UserDetailStatus}" for="status" /&gt;
                                                  &lt;h:inputText id="status" value="#{userDetailBean.status}" /&gt;
                                                  &lt;h:inputHidden /&gt; &lt;h:inputHidden /&gt; &lt;h:inputHidden /&gt; &lt;h:inputHidden /&gt; &lt;h:inputHidden /&gt;
                                                  &amp;nbsp;
                                                  &lt;h:outputLabel value="#{msgs.UserDetailComments}" for="comments" /&gt;
                                                  &lt;h:inputTextarea id="comments" value="#{userDetailBean.comments}" /&gt;
                                                  &lt;h:inputHidden /&gt;
                                                  &lt;p:commandButton ajax="false" action="#{userDetailBean.submitChanges()}" value="Submit Changes" /&gt;
                                              &lt;/h:panelGrid&gt;
                                          &lt;/p:tab&gt;
                                      &lt;/p:tabView&gt;
                                  &lt;/td&gt;
                              &lt;/tr&gt;
  
                          &lt;/table&gt;
                          &lt;/h:form&gt;
                      &lt;/c:if&gt;
                      &lt;c:if test="#{! empty userDetailBean.view}"&gt;
                          &lt;h:form&gt;
                          &lt;table align="center"&gt;
                              &lt;tr&gt;
                                  &lt;td&gt;
                                      &lt;p:tabView&gt;
                                          &lt;p:tab title="#{msgs.UserDetailViewTabTitle}"&gt;
                                              &lt;h:panelGrid columns="4"&gt;
                                                  &lt;h:outputLabel value="#{msgs.UserDetailFirstName}" for="fname" /&gt;
                                                  &lt;h:outputText id="fname" value="#{userGridBean.selectedUser.firstName}" /&gt;
                                                  &lt;h:outputLabel value="#{msgs.UserDetailJobTitle}" for="jtitle" /&gt;
                                                  &lt;h:outputText id="jtitle" value="#{userGridBean.selectedUser.jobTitle}" /&gt;
                                                  &lt;h:outputLabel value="#{msgs.UserDetailLastName}" for="lname" /&gt;
                                                  &lt;h:outputText id="lname" value="#{userGridBean.selectedUser.lastName}" /&gt;
                                                  &lt;h:outputLabel value="#{msgs.UserDetailEmployeeId}" for="empid" /&gt;
                                                  &lt;h:outputText id="empid" value="#{userGridBean.selectedUser.id}" /&gt;
                                                  &lt;h:outputLabel value="#{msgs.UserDetailDateOfHire}" for="doh" /&gt;
                                                  &lt;h:outputText id="doh" value="#{userGridBean.selectedUser.DOH}" /&gt;
                                                  &lt;h:outputLabel value="#{msgs.UserDetailLocation}" for="location" /&gt;
                                                  &lt;h:outputText id="location" value="#{userGridBean.selectedUser.location}" /&gt;
                                                  &lt;h:outputLabel value="#{msgs.UserDetailStatus}" for="status" /&gt;
                                                  &lt;h:outputText id="status" value="#{userGridBean.selectedUser.status}" /&gt;
                                                  &lt;h:inputHidden /&gt; &lt;h:inputHidden /&gt; &lt;h:inputHidden /&gt; &lt;h:inputHidden /&gt; &lt;h:inputHidden /&gt;
                                                  &amp;nbsp;
                                                  &lt;h:outputLabel value="#{msgs.UserDetailComments}" for="comments" /&gt;
                                                  &lt;h:outputText id="comments" value="#{userGridBean.selectedUser.comments}" /&gt;
                                                  &lt;h:inputHidden /&gt; &lt;h:inputHidden /&gt; &lt;h:inputHidden /&gt;
                                                  &lt;p:commandButton onclick="submit()" ajax="false" action="#{userDetailBean.navigation()}" value="Retur to User Grid" /&gt;
                                              &lt;/h:panelGrid&gt;
                                          &lt;/p:tab&gt;
                                      &lt;/p:tabView&gt;
                                  &lt;/td&gt;
                              &lt;/tr&gt;
                          &lt;/table&gt;
                          &lt;/h:form&gt;
                      &lt;/c:if&gt;                 
  
              &lt;/ui:define&gt;
          &lt;/ui:composition&gt;        
      &lt;/body&gt;
  </code></pre>
  
  <p>I've tried everything I can think of for the second button: ajax="false"; onclick="submit()"; ajax="false" onclick="submit"; I've tried implicit navigation with a redirect as well as a navigation rule with a redirect.  The action methods userDetailBean.submitChanges() and userDetailBean.navigate() both return the same string, which corresponds to a navigation rule in my faces-config file.  The submitChanges method gets called, but my navigate method does not.  I'm not filling the fields with any data at this point, I'm just trying to get the basic navigation to work.  Why isn't my commandButton on the second tabView working?</p>