title: p:commandButton action not invoked after and ajax update
body: <p>I have a JSF page which has a p:commandButton which has ajax=true and renders a p:panel which is wrapped in p:outputPanel when clicked. When this button is clicked the action method will set showCreateUser value in ManagedBean to true and this is used to render the Panel. This works fine - on button click the panel is rendered properly. Inside the p:panel there is another p:commandButton. This commanButton is not working as nothing happens when I click on it. The action method is never invoked. When I debug I realised that even though the ajax action sets showCreateUser to true but when I click on second button the showCreateUser value is false. So, the panel panel rendered=false and so the action is never invoked. Following are the xhtml and managedbean class. How can I resolve this? Thanks for your help!</p>
  
  <p>registration.xhtml</p>
  
  <pre><code>&lt;h:form id="userForm" style="background-color:white;border:0px; width:90%;"&gt;
     &lt;p:messages id="messagesForDebugging"
                 showDetail="true"
                 autoUpdate="true" /&gt;
     &lt;ui:debug hotkey="x"/&gt;
     &lt;div style="margin-bottom: 10px;"&gt;
         &lt;p:commandButton id="btnConfirmYes" value="Yes" ajax="true" update="userRegOutPanel" 
                 action="#{regBean.confirmYes}" styleClass="button" style="height:35px;"&gt;
          &lt;!-- &lt;f:ajax render="userRegOutPanel" execute="userRegOutPanel"/&gt; --&gt;
         &lt;/p:commandButton&gt;
  
         &lt;p:commandButton id="btnConfirmNo" value="No" ajax="false"
               action="#{regBean.confirmNo}" styleClass="button" style="height:35px;"/&gt;
     &lt;/div&gt;
  
     &lt;p:outputPanel id="userRegOutPanel"&gt;
          &lt;p:panel id="userRegPanel" rendered="#{regBean.showCreateUser}"&gt;
              &lt;p:panelGrid id="userRegPanelGrid"&gt;
                  &lt;p:row&gt;
                     &lt;p:column style="width:40%;background-color:#00a5b6;-moz-border-radius: 10px;-webkit-border-radius: 10px;-khtml-border-radius: 10px;border-radius: 10px;text-align:left;"&gt;
  
                        &lt;h:inputHidden id="ssn" value="#{regBean.ssn}"/&gt;
  
                        &lt;p:panelGrid&gt;
                            &lt;p:row&gt;
                                &lt;p:column&gt;
                                    &lt;p:commandButton value="Submit" ajax="true" action="#{regBean.submitRegistration}"                                                 
                                             styleClass="button" style="width:140px;height:35px;" type="submit"/&gt;
                                &lt;/p:column&gt;
                            &lt;/p:row&gt;
                        &lt;/p:panelGrid&gt;
                     &lt;/p:column&gt;
                  &lt;/p:row&gt;
              &lt;/p:panelGrid&gt;
          &lt;/p:panel&gt;
     &lt;/p:outputPanel&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>Managed Bean</p>
  
  <pre><code>    @ManagedBean
          @ViewScoped
          public class RegBean implements Serializable{
  
      private static final long serialVersionUID = 1L;
      static Logger log = LoggerFactory.getLogger(RegBean.class);
  
      private String ssn;
  
      private boolean showCreateUser = false;
  
      public void confirmYes(){
          setShowCreateUser(true);
      }
  
      public String confirmNo(){
          log.info("In retrieveRegistration");
          FacesContext fc = FacesContext.getCurrentInstance();
          fc.addMessage("registrationError", new FacesMessage(
                  FacesMessage.SEVERITY_ERROR,
                  "Error. Contact customer service",
                  "Error. Contact customer service"));
          return "/registration/registrationError";
      }
  
      public String submitRegistration() {  
          log.info("In submitRegistration");
          FacesContext fc = FacesContext.getCurrentInstance();
  
          return "/secured/home";
      }  
  
      public String getSsn() {
          return ssn;
      }
      public void setSsn(String ssn) {
          this.ssn = ssn;
      }
  
      public boolean isShowCreateUser() {
          return showCreateUser;
      }
  
      public void setShowCreateUser(boolean showCreateUser) {
          this.showCreateUser = showCreateUser;
      }
  }
  </code></pre>