title: Updating entire <p:dataTable> on complete of <p:ajax event="cellEdit">
body: <p>I am having difficulty re-rendering a PrimeFaces Datatable once a cell has been edited. Changing the value in one cell may change entries in the other cells, hence the need to refresh the entire table. </p>
  
  <p>Here's the JSF page:</p>
  
  <pre><code>&lt;h:form id="testForm"&gt;
      &lt;p:outputPanel id="testContainer"&gt;
  
          &lt;p:dataTable id="testTable" value="#{tableBean.data}" var="entry" editable="true" editMode="cell"&gt;
  
              &lt;p:ajax event="cellEdit" listener="#{tableBean.onCellEdit}" update=":testForm:testContainer" /&gt;
  
              &lt;p:column headerText="Col1"&gt;  
                  &lt;p:cellEditor&gt;
                      &lt;f:facet name="output"&gt;&lt;h:outputText value="#{entry.col1}" /&gt;&lt;/f:facet&gt;
                      &lt;f:facet name="input"&gt;&lt;p:inputText value="#{entry.col1}" /&gt;&lt;/f:facet&gt;
                  &lt;/p:cellEditor&gt; 
              &lt;/p:column&gt;
  
              &lt;p:column headerText="Col2"&gt;
                  &lt;p:cellEditor&gt;
                      &lt;f:facet name="output"&gt;&lt;h:outputText value="#{entry.col2}" /&gt;&lt;/f:facet&gt;
                      &lt;f:facet name="input"&gt;&lt;p:inputText value="#{entry.col2}" /&gt;&lt;/f:facet&gt;
                  &lt;/p:cellEditor&gt;  
              &lt;/p:column&gt;
  
          &lt;/p:dataTable&gt;
  
          &lt;p:commandButton id="refreshButton" value="Redisplay" update="testContainer" /&gt;
  
      &lt;/p:outputPanel&gt;                                    
  &lt;/h:form&gt;
  </code></pre>
  
  <p>And here's the backing bean:</p>
  
  <pre><code>@ManagedBean(name = "tableBean", eager = false)
  @ViewScoped 
  public class TableBean {
  
      public TableBean() {
          RowData entry = new RowData("a1", "b1");
          entries.add(entry);
          entry = new RowData("a2", "b2");
          entries.add(entry);
          entry = new RowData("a3", "b3");
          entries.add(entry);
      }
  
      public class RowData {
  
          private String col1;
          private String col2;
  
          public RowData(String col1, String col2) {
              this.col1 = col1;
              this.col2 = col2;
          }
  
          public String getCol1() {
              return col1;
          }
  
          public void setCol1(String col1) {
              this.col1 = col1;
          }
  
          public String getCol2() {
              return col2;
          }
  
          public void setCol2(String col2) {
              this.col2 = col2;
          }
      }
  
      private ArrayList&lt;RowData&gt; entries = new ArrayList&lt;RowData&gt;();
  
      public List&lt;RowData&gt; getData() {
          return entries;
      }
  
      public void onCellEdit(CellEditEvent event) {
          entries.get(event.getRowIndex()).setCol1("Dummy Col 1");
          entries.get(event.getRowIndex()).setCol2("Dummy Col 2");        
      }   
  }
  </code></pre>
  
  <p>When including update=":testForm:testContainer" within the cellEdit AJAX event, changing a cell value deletes the datatable on screen and only renders the cell content (along with the button) -- I do not understand why this is. When the update attribute is not specified, the table remains on screen with the active cell updated, but none of the other cells are updated (as to be expected).</p>
  
  <p>The desired behaviour can be achieved (in a non-automated way) by not specifying the update attribute within the AJAX cellEdit event and clicking the Redisplay button after editing a cell's value. How can I achieve this in an automated way, and why does the update attribute not work as I expect?</p>
  
  <p>I am using PrimeFaces 4.0.</p>