title: primefaces commandbutton actionlistener not called
body: <p>I am using <code>primefaces 3.0</code> and <code>jsf 2.0</code>.<br>
  I have prepared client master which add client using wizard and at the same time reflected in datatable. Then I have updated edit utility in datatable. Then I have added delete button in datatable and try call delete method of bean.<br>
  But when I click on delete button wizard validation for adding client is executed.
  So I have created another file <code>ClientEditdatatable.xhtml</code> and included in <code>clientmaster.xhtml</code>but same result remain.
  Now I want to add delete utility in datatable. I have tried many tricks to do it.<br>
  I just want to pass client id through action listener,get deleted and refresh datatable but command button not executing method.<br>
  Kindly advice.
  My code as below: </p>
  
  <pre><code>ClientMaster.xhtml
  
  &lt;h:body&gt; 
      &lt;ui:composition template="/template/mainLayout.xhtml" &gt;
          &lt;ui:define name="pageContent"&gt;
              &lt;h:form id="cm"&gt;
                  &lt;p:growl life="5000" showDetail="true" showSummary="true" id="mymessage" autoUpdate="true"/&gt;
                  &lt;br/&gt;
                  user id :#{sessionScope.USER_ID};
                  &lt;br/&gt;
                  &lt;p:wizard widgetVar="wiz" flowListener="#{clientUitility.onFlowProcess}" showNavBar="true"  &gt;
                      &lt;p:tab id="personal" title="Personal" &gt;
                          &lt;p:panel id="personal1" header="Personal Details"&gt;
                              &lt;!-- &lt;h:messages errorClass="error"/&gt; --&gt;
                              &lt;h:panelGrid columns="6" styleClass="grid"&gt;
                                  &lt;h:outputText value="First Name:*" /&gt;
                                  &lt;p:inputText required="true" label="FirstName"
                                               value="#{clientUitility.client.firstName}" &gt;
                                  &lt;/p:inputText&gt;
  
                                  &lt;h:outputText value="Middle Name:*" /&gt;
                                  &lt;p:inputText required="true" label="MidddleName"
                                               value="#{clientUitility.client.middleName}" /&gt;
  
                                  &lt;h:outputText value="Last Name:*" /&gt;
                                  &lt;p:inputText required="true" label="LastName"
                                               value="#{clientUitility.client.lastName}" /&gt;
  
                                  &lt;h:outputText value="Login ID:* " /&gt;
                                  &lt;p:inputText required="true" label="LoginID"
                                               value="#{clientUitility.client.loginID}"/&gt;
  
                                  &lt;h:outputText value="Password:* " /&gt;
                                  &lt;p:inputText required="true" label="Password"
                                               value="#{clientUitility.client.password}"/&gt;
                              &lt;/h:panelGrid&gt;
                          &lt;/p:panel&gt;
                      &lt;/p:tab&gt;
                      &lt;p:tab id="address" title="Address" &gt;
                          &lt;p:panel id="address1" header="Adress Details"&gt;
                              &lt;!-- &lt;h:messages errorClass="error"/&gt; --&gt;
                              &lt;h:panelGrid columns="6" styleClass="grid"&gt;
                                  &lt;h:outputText value="Address:*" /&gt;
                                  &lt;p:inputText required="true" label="Address1"
                                               value="#{clientUitility.client.address1}" /&gt;
                                  &lt;h:outputText /&gt;
                                  &lt;p:inputText label="Address2"
                                               value="#{clientUitility.client.address2}" /&gt;
                                  &lt;h:outputText /&gt;
                                  &lt;p:inputText label="Address3"
                                               value="#{clientUitility.client.address3}" /&gt;
                                  &lt;h:outputText value="City:* " /&gt;
                                  &lt;p:inputText required="true" label="City"
                                               value="#{clientUitility.client.city}" /&gt;
  
                                  &lt;h:outputText value="Pincode:* " /&gt;
                                  &lt;p:inputText required="true" label="Pincode"
                                               value="#{clientUitility.client.pincode}" /&gt;
                                  &lt;h:outputText value="State:* " /&gt;
                                  &lt;p:inputText required="true" label="State"
                                               value="#{clientUitility.client.state}" /&gt;
                              &lt;/h:panelGrid&gt;
                          &lt;/p:panel&gt;
                      &lt;/p:tab&gt;
                      &lt;p:tab id="contact" title="Contact" &gt;
                          &lt;p:panel id="contact1" header="Contact Information"&gt;
                              &lt;!-- &lt;h:messages errorClass="error"/&gt; --&gt;
                              &lt;p:panelGrid columns="4" styleClass="grid"&gt;
                                  &lt;h:outputText value="Mobile:* " /&gt;
                                  &lt;p:inputText required="true" label="MobileNo"
                                               value="#{clientUitility.client.mobileNo}" /&gt;
                                  &lt;h:outputText value="Email ID: "/&gt;
                                  &lt;p:inputText label="EmailID"
                                               value="#{clientUitility.client.emailID}" /&gt;
                                  &lt;h:outputText value="STD Code: "/&gt;
                                  &lt;p:inputText label="STDCode"
                                               value="#{clientUitility.client.stdCode}" /&gt;
                                  &lt;h:outputText value="Phone No: "/&gt;
                                  &lt;p:inputText label="PhoneNo"
                                               value="#{clientUitility.client.phoneNo}" /&gt;                                &lt;/p:panelGrid&gt;
                          &lt;/p:panel&gt;
                      &lt;/p:tab&gt;
  
                      &lt;p:tab id="confirm" title="Confirmation" &gt;
                          &lt;p:panel id="confirm1" header="Confirm and Submit"&gt;
  
                              &lt;h:panelGrid  columns="6" styleClass="grid" &gt;
  
                                  &lt;h:outputText value="First Name: " /&gt;
                                  &lt;h:outputText styleClass="outputLabel"
                                                value="#{clientUitility.client.firstName}" /&gt;
                                  &lt;h:outputText value="Middle Name: " /&gt;
                                  &lt;h:outputText styleClass="outputLabel"
                                                value="#{clientUitility.client.middleName}" /&gt;
                                  &lt;h:outputText value="Last Name: " /&gt;
                                  &lt;h:outputText styleClass="outputLabel"
                                                value="#{clientUitility.client.lastName}" /&gt;
                                  &lt;h:outputText value="Login ID: " /&gt;
                                  &lt;h:outputText styleClass="outputLabel"
                                                value="#{clientUitility.client.loginID}"/&gt;
                                  &lt;h:outputText value="Password: " /&gt;
                                  &lt;h:outputText styleClass="outputLabel"
                                               value="#{clientUitility.client.password}"/&gt;
                                  &lt;h:outputText/&gt;
                                  &lt;h:outputText/&gt;
                                  &lt;h:outputText value="Address: " /&gt;
                                  &lt;h:outputText styleClass="outputLabel"
                                                value="#{clientUitility.client.address1}" /&gt;
                                  &lt;h:outputText /&gt;
                                  &lt;h:outputText styleClass="outputLabel"
                                                value="#{clientUitility.client.address2}" /&gt;
                                  &lt;h:outputText /&gt;
                                  &lt;h:outputText styleClass="outputLabel"
                                                value="#{clientUitility.client.address3}" /&gt;
                                  &lt;h:outputText value="City: " /&gt;
                                  &lt;h:outputText styleClass="outputLabel"
                                                value="#{clientUitility.client.city}" /&gt;
                                  &lt;h:outputText value="State: " /&gt;
                                  &lt;h:outputText styleClass="outputLabel"
                                                value="#{clientUitility.client.state}" /&gt;
                                  &lt;h:outputText value="Pincode: " /&gt;
                                  &lt;h:outputText styleClass="outputLabel"
                                                value="#{clientUitility.client.pincode}" /&gt;
                                  &lt;h:outputText value="Email ID: " /&gt;
                                  &lt;h:outputText styleClass="outputLabel"
                                                value="#{clientUitility.client.emailID}" /&gt;
                                  &lt;p:commandButton id="addClient" immediate="true" value="Add Client" actionListener="#{clientUitility.save}" oncomplete="wiz.loadStep (wiz.cfg.steps [0], true)" update="@parent,:cm:clientList"&gt; &lt;!-- update="@parent,:cm:clientList" --&gt;
                                  &lt;/p:commandButton&gt;
                              &lt;/h:panelGrid&gt;
                          &lt;/p:panel&gt;
                      &lt;/p:tab&gt;
                  &lt;/p:wizard&gt;
                  &lt;ui:include id="ce" src="ClientEditDatatable.xhtml"/&gt;
              &lt;/h:form&gt;              
          &lt;/ui:define&gt;
      &lt;/ui:composition&gt; 
  &lt;/h:body&gt; 
  </code></pre>
  
  <p></p>
  
  <p>ClientEditDatatable.xhtml</p>
  
  <pre><code>&lt;h:body&gt;
       &lt;h:form id="fce"&gt;
          &lt;p:confirmDialog message="Delete client?" severity="alert" widgetVar="confirmDeleteClient" visible="false" appendToBody="true"&gt;
              &lt;p:commandButton value="Yes" update=":cm:fce:clientList" oncomplete="confirmDeleteClient.hide()" actionListener="#{clientUitility.deleteRecord}" &gt; 
              &lt;/p:commandButton&gt;
              &lt;p:commandButton value="No" onclick="confirmDeleteClient.hide()" type="button" /&gt;
          &lt;/p:confirmDialog&gt;
          &lt;p:dataTable var="client" value="#{clientUitility.clientAll}" id="clientList" editable="true"
                       rowKey="#{client.clientID}" paginator="true" rows="10" rowsPerPageTemplate="10,15,20"&gt;
              &lt;p:column headerText="First Name" style="width:125px" filterBy="#{user.firstname}" sortBy="#{client.firstName}"&gt;
                  &lt;p:cellEditor&gt;
                      &lt;f:facet name="output"&gt;
                          &lt;h:outputText value="#{client.firstName}" /&gt;
                      &lt;/f:facet&gt;
                      &lt;f:facet name="input"&gt;
                          &lt;h:outputText value="#{client.firstName}" /&gt;
                      &lt;/f:facet&gt;
                  &lt;/p:cellEditor&gt;
              &lt;/p:column&gt;
              &lt;p:column headerText="Middle Name" style="width:125px" filterBy="#{client.middleName}" sortBy="#{client.middleName}"&gt;
                  &lt;p:cellEditor&gt;
                      &lt;f:facet name="output"&gt;
                          &lt;h:outputText value="#{client.middleName}" /&gt;
                      &lt;/f:facet&gt;
                      &lt;f:facet name="input"&gt;
                          &lt;p:inputText value="#{client.middleName}" style="width:100%" &gt;
                          &lt;/p:inputText&gt;
                      &lt;/f:facet&gt;
                  &lt;/p:cellEditor&gt;
              &lt;/p:column&gt;
  
              &lt;p:column headerText="Last Name" style="width:125px" filterBy="#{client.lastName}" sortBy="#{client.lastName}" &gt;
                  &lt;p:cellEditor&gt;
                      &lt;f:facet name="output"&gt;
                          &lt;h:outputText value="#{client.lastName}" /&gt;
                      &lt;/f:facet&gt;
                      &lt;f:facet name="input"&gt;
                          &lt;p:inputText value="#{client.lastName}" style="width:100%" &gt;
                          &lt;/p:inputText&gt;
                      &lt;/f:facet&gt;
                  &lt;/p:cellEditor&gt;
              &lt;/p:column&gt;
  
              &lt;p:column headerText="Login ID" style="width:125px" filterBy="#{client.loginID}" sortBy="#{client.loginID}"&gt;
                  &lt;p:cellEditor&gt;
                      &lt;f:facet name="output"&gt;
                          &lt;h:outputText value="#{client.loginID}" /&gt;
                      &lt;/f:facet&gt;
                      &lt;f:facet name="input"&gt;
                          &lt;p:inputText value="#{client.loginID}" style="width:100%" &gt;
                          &lt;/p:inputText&gt;
                      &lt;/f:facet&gt;
                  &lt;/p:cellEditor&gt;
              &lt;/p:column&gt;
  
              &lt;p:column headerText="Password" style="width:125px" filterBy="#{client.password}" sortBy="#{client.password}"&gt;
                  &lt;p:cellEditor&gt;
                      &lt;f:facet name="output"&gt;
                          &lt;h:outputText value="#{client.password}" /&gt;
                      &lt;/f:facet&gt;
                      &lt;f:facet name="input"&gt;
                          &lt;p:inputText value="#{client.password}" style="width:100%" &gt;
                          &lt;/p:inputText&gt;
                      &lt;/f:facet&gt;
                  &lt;/p:cellEditor&gt;
              &lt;/p:column&gt;
              &lt;p:column headerText="Address1" style="width:125px" filterBy="#{client.address1}" sortBy="#{client.address1}"&gt;
                  &lt;p:cellEditor&gt;
                      &lt;f:facet name="output"&gt;
                          &lt;h:outputText value="#{client.address1}" /&gt;
                      &lt;/f:facet&gt;
                      &lt;f:facet name="input"&gt;
                          &lt;p:inputText value="#{client.address1}" style="width:100%" &gt;
                          &lt;/p:inputText&gt;
                      &lt;/f:facet&gt;
                  &lt;/p:cellEditor&gt;
              &lt;/p:column&gt;
              &lt;p:column headerText="Address2" style="width:125px" filterBy="#{client.address2}" sortBy="#{client.address2}"&gt;
                  &lt;p:cellEditor&gt;
                      &lt;f:facet name="output"&gt;
                          &lt;h:outputText value="#{client.address2}" /&gt;
                      &lt;/f:facet&gt;
                      &lt;f:facet name="input"&gt;
                          &lt;p:inputText value="#{client.address2}" style="width:100%" &gt;
                          &lt;/p:inputText&gt;
                      &lt;/f:facet&gt;
                  &lt;/p:cellEditor&gt;
              &lt;/p:column&gt;
              &lt;p:column headerText="Address3" style="width:125px" filterBy="#{client.address3}" sortBy="#{client.address3}"&gt;
                  &lt;p:cellEditor&gt;
                      &lt;f:facet name="output"&gt;
                          &lt;h:outputText value="#{client.address3}" /&gt;
                      &lt;/f:facet&gt;
                      &lt;f:facet name="input"&gt;
                          &lt;p:inputText value="#{client.address3}" style="width:100%" &gt;
                          &lt;/p:inputText&gt;
                      &lt;/f:facet&gt;
                  &lt;/p:cellEditor&gt;
              &lt;/p:column&gt;
              &lt;p:column headerText="City" style="width:125px" filterBy="#{client.city}" sortBy="#{client.city}"&gt;
                  &lt;p:cellEditor&gt;
                      &lt;f:facet name="output"&gt;
                          &lt;h:outputText value="#{client.city}" /&gt;
                      &lt;/f:facet&gt;
                      &lt;f:facet name="input"&gt;
                          &lt;p:inputText value="#{client.city}" style="width:100%" &gt;
                          &lt;/p:inputText&gt;
                      &lt;/f:facet&gt;
                  &lt;/p:cellEditor&gt;
              &lt;/p:column&gt;
              &lt;p:column headerText="State" style="width:125px" filterBy="#{client.state}" sortBy="#{client.state}"&gt;
                  &lt;p:cellEditor&gt;
                      &lt;f:facet name="output"&gt;
                          &lt;h:outputText value="#{client.state}" /&gt;
                      &lt;/f:facet&gt;
                      &lt;f:facet name="input"&gt;
                          &lt;p:inputText value="#{client.state}" style="width:100%" &gt;
                          &lt;/p:inputText&gt;
                      &lt;/f:facet&gt;
                  &lt;/p:cellEditor&gt;
              &lt;/p:column&gt;
              &lt;p:column headerText="Pincode" style="width:125px" filterBy="#{client.pincode}" sortBy="#{client.pincode}"&gt;
                  &lt;p:cellEditor&gt;
                      &lt;f:facet name="output"&gt;
                          &lt;h:outputText value="#{client.pincode}" /&gt;
                      &lt;/f:facet&gt;
                      &lt;f:facet name="input"&gt;
                          &lt;p:inputText value="#{client.pincode}" style="width:100%" &gt;
                          &lt;/p:inputText&gt;
                      &lt;/f:facet&gt;
                  &lt;/p:cellEditor&gt;
              &lt;/p:column&gt;
              &lt;p:column headerText="Mobile No" style="width:125px" filterBy="#{client.mobileNo}" sortBy="#{client.mobileNo}"&gt;
                  &lt;p:cellEditor&gt;
                      &lt;f:facet name="output"&gt;
                          &lt;h:outputText value="#{client.mobileNo}" /&gt;
                      &lt;/f:facet&gt;
                      &lt;f:facet name="input"&gt;
                          &lt;p:inputText value="#{client.mobileNo}" style="width:100%" &gt;
                          &lt;/p:inputText&gt;
                      &lt;/f:facet&gt;
                  &lt;/p:cellEditor&gt;
              &lt;/p:column&gt;
              &lt;p:column headerText="STD Code" style="width:125px" filterBy="#{client.stdCode}" sortBy="#{client.stdCode}"&gt;
                  &lt;p:cellEditor&gt;
                      &lt;f:facet name="output"&gt;
                          &lt;h:outputText value="#{client.stdCode}" /&gt;
                      &lt;/f:facet&gt;
                      &lt;f:facet name="input"&gt;
                          &lt;p:inputText value="#{client.stdCode}" style="width:100%" &gt;
                          &lt;/p:inputText&gt;
                      &lt;/f:facet&gt;
                  &lt;/p:cellEditor&gt;
              &lt;/p:column&gt;
              &lt;p:column headerText="Phone No" style="width:125px" filterBy="#{client.phoneNo}" sortBy="#{client.phoneNo}"&gt;
                  &lt;p:cellEditor&gt;
                      &lt;f:facet name="output"&gt;
                          &lt;h:outputText value="#{client.phoneNo}" /&gt;
                      &lt;/f:facet&gt;
                      &lt;f:facet name="input"&gt;
                          &lt;p:inputText value="#{client.phoneNo}" style="width:100%" &gt;
                          &lt;/p:inputText&gt;
                      &lt;/f:facet&gt;
                  &lt;/p:cellEditor&gt;
              &lt;/p:column&gt;
              &lt;p:column headerText="Email ID" style="width:125px" filterBy="#{client.emailID}" sortBy="#{client.emailID}"&gt;
                  &lt;p:cellEditor&gt;
                      &lt;f:facet name="output"&gt;
                          &lt;h:outputText value="#{client.emailID}" /&gt;
                      &lt;/f:facet&gt;
                      &lt;f:facet name="input"&gt;
                          &lt;p:inputText value="#{client.emailID}" style="width:100%" &gt;
                          &lt;/p:inputText&gt;
                      &lt;/f:facet&gt;
                  &lt;/p:cellEditor&gt;
              &lt;/p:column&gt;
              &lt;p:column headerText="Edit" style="width:50px"&gt;
                  &lt;p:rowEditor /&gt;
              &lt;/p:column&gt;
              &lt;p:ajax event="rowEdit" listener="#{clientUitility.editRowListner}" update=":cm:mymessage"/&gt;
  
              &lt;p:column headerText="Delete" style="width:50px"&gt;
                  &lt;p:commandButton id="deleteClient" value="Delete" onclick="confirmDeleteClient.show()" title="Delete this Client" styleClass="ui-icon-closethick"&gt;
                  &lt;/p:commandButton&gt;
              &lt;/p:column&gt;
          &lt;/p:dataTable&gt;
      &lt;/h:form&gt; 
  &lt;/h:body&gt;
  </code></pre>
  
  <p></p>
  
  <p>clientUtility.java</p>
  
  <pre><code>@ManagedBean
  @ViewScoped
  public class ClientUitility {
  private ClientBean client = new ClientBean();
  private List&lt;ClientBean&gt; clientAll = new ArrayList&lt;ClientBean&gt;();
  /** Creates a new instance of ClientUitility */
  public ClientUitility() {
      clientAll = new ArrayList&lt;ClientBean&gt;();
      int userID = Integer.parseInt(FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("USER_ID").toString());
      clientAll = ClientService.GenerateClientList(userID);
  }
  public List&lt;ClientBean&gt; getClientAll() {
      return clientAll;
  }
  public void setClientAll(List&lt;ClientBean&gt; clientAll) {
      this.clientAll = clientAll;
  }
  public ClientBean getClient() {
      return client;
  }
  public void setClient(ClientBean client) {
      this.client = client;
  }
  public String onFlowProcess(FlowEvent event) {
      System.out.println("Current wizard step:" + event.getOldStep());
      System.out.println("Next step:" + event.getNewStep());
      System.out.println("First name : " + client.getfirstName());
      System.out.println("Last name : " + client.getlastName());
      System.out.println("Age name : " + client.getloginID());
      return event.getNewStep();
  }
  public void editRowListner(RowEditEvent rowEditEvent) {
      try {
          ClientBean updatedClient = (ClientBean) rowEditEvent.getObject();
          System.out.println("Client First Name: " + updatedClient.getfirstName());
          ClientService.EditClient(updatedClient);
          FacesContext context = FacesContext.getCurrentInstance();
          context.addMessage(null, new FacesMessage("Updated", updatedClient.getfirstName() + " " + updatedClient.getlastName()));
      } catch (Exception e) {
          e.getMessage();
      }
  }
  public void deleteRecord(ActionEvent actionEvent) {
      try {
          //System.out.println("Client ID: " + actionEvent.getComponent().getAttributes().get("cID").toString());
          System.out.println("delete client of User ID: " + FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("USER_ID").toString());
          FacesMessage msg = new FacesMessage("Client Deleted", "");
          FacesContext.getCurrentInstance().addMessage(null, msg);
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  public void save(ActionEvent actionEvent) {        client.setuserID(Integer.parseInt(FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("USER_ID").toString()));
      System.out.println("Client ID : " + client.getclientID());
      System.out.println("User ID : " + client.getuserID());
      ClientService.AddClient(client);
      client = new ClientBean();
      clientAll = ClientService.GenerateClientList(Integer.parseInt(FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("USER_ID").toString()));
      FacesMessage msg = new FacesMessage("Client Created", "");
      FacesContext.getCurrentInstance().addMessage(null, msg);
  }
  }
  </code></pre>
  
  <p>Kindly advice where am I mistaking?</p>