title: Primefaces - update datatable with commandButton doesn't work
body: <p>I'm facing some problems by updating a datatable with a commandButton. This is the xhtml file:</p>
  
  <pre><code>&lt;div class="grid_16"&gt;
     &lt;h:form id="list"&gt;
        &lt;p:messages&gt;&lt;/p:messages&gt;
        &lt;p:dataTable styleClass="result-table" var="user" id="usersList"
           value="#{listUsersController.users}" widgetVar="userTable"
           paginator="true" rows="10" paginatorAlwaysVisible="false"&gt;
           &lt;f:facet name="header"&gt;
              Listado de usuarios
           &lt;/f:facet&gt;
           &lt;p:column&gt;
              &lt;f:facet name="header"&gt;
                 &lt;h:outputText value="#{cms['users.username']}" /&gt;
              &lt;/f:facet&gt;
              #{user.username}
           &lt;/p:column&gt;
           &lt;p:column&gt;
              &lt;f:facet name="header"&gt;
                 &lt;h:outputText value="#{cms['users.name']}" /&gt;
              &lt;/f:facet&gt;
              #{user.name}
           &lt;/p:column&gt;
           &lt;p:column&gt;
              &lt;f:facet name="header"&gt;
                 &lt;h:outputText value="#{cms['users.lastname']}" /&gt;
              &lt;/f:facet&gt;
              #{user.lastname}
           &lt;/p:column&gt;
           &lt;p:column&gt;
              &lt;f:facet name="header"&gt;
                 &lt;h:outputText value="#{cms['users.active']}" /&gt;
              &lt;/f:facet&gt;
              #{user.active}
           &lt;/p:column&gt;
           &lt;p:column&gt;
              &lt;f:facet name="header"&gt;
                 &lt;h:outputText value="#{cms['general.actions']}" /&gt;
              &lt;/f:facet&gt;
              &lt;p:commandButton value="Eliminar" image="ui-icon-trash"
                 actionListener="#{listUsersController.deleteUser}"
                 update="list:usersList"&gt;
                 &lt;f:param name="user" value="#{user.id}" /&gt;
              &lt;/p:commandButton&gt;
           &lt;/p:column&gt;
        &lt;/p:dataTable&gt;
     &lt;/h:form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The problem is when clicking the commandButton that performs the action listUsersController.deleteUser. The method is successfully executed and the user is deleted. But the datatable is not updated. I want the deleted record to not appear anymore in the list with ajax.</p>
  
  <p>I already tested with <code>update="@form"</code>, <code>update="@parent"</code>, <code>update="@all"</code>, <code>update="usersList"</code>, <code>update=":list:usersList"</code> and nothing works.</p>
  
  <p>This is the method in the managedBean:</p>
  
  <pre><code>public String deleteUser() {
          try {
              FacesContext fc = FacesContext.getCurrentInstance();
              Map&lt;String, String&gt; params = fc.getExternalContext().getRequestParameterMap();
              int id = Integer.parseInt(params.get("user"));
              userService.removeUserById(id);
              FacesContext.getCurrentInstance().addMessage
              (null,new FacesMessage(FacesMessage.SEVERITY_INFO,MessageProvider.getMessageProvider()
              .getValue("cms","users.error.userDoesNotExist"),""));   
              return SUCCESS;
          } catch (EntityNotFoundException e) {
              FacesContext.getCurrentInstance().addMessage(null,new FacesMessage(FacesMessage.SEVERITY_ERROR,MessageProvider
                      .getMessageProvider().getValue("cms","users.error.userDoesNotExist"),""));
              return ERROR;
          }
      }
  </code></pre>