title: GWT RequestFactory + CellTable
body: <p>Does anyone know for an example of GWT's CellTable using RequestFactory and that table is being edited? I would like to list objects in a table (each row is one object and each column is one property), be able to easily add new objects and edit. I know for Google's DynaTableRf example, but that one doesn't edit.</p>
  
  <p>I searched Google and stackoverflow but wasn't able to find one. I got a bit confused with RF's context and than people also mentioned some "driver".</p>
  
  <p>To demonstrate where I currently arrived, I attach code for one column:</p>
  
  <pre><code>        // Create name column.
      Column&lt;PersonProxy, String&gt; nameColumn = new Column&lt;PersonProxy, String&gt;(
              new EditTextCell()) {
          @Override
          public String getValue(PersonProxy person) {
              String ret = person.getName();
              return ret != null ? ret : "";
          }
      };
  
  
      nameColumn.setFieldUpdater(new FieldUpdater&lt;PersonProxy, String&gt;() {            
          @Override
          public void update(int index, PersonProxy object, String value) {
              PersonRequest req = FaceOrgFactory.getInstance().requestFactory().personRequest();
              PersonProxy eObject = req.edit(object);             
              eObject.setName(value);
              req.persist().using(eObject).fire();
          }
      });
  </code></pre>
  
  <p>and my code for data provider:</p>
  
  <pre><code>        AsyncDataProvider&lt;PersonProxy&gt; personDataProvider = new AsyncDataProvider&lt;PersonProxy&gt;() {
          @Override
          protected void onRangeChanged(HasData&lt;PersonProxy&gt; display) {
            final Range range = display.getVisibleRange();
  
            fetch(range.getStart());
          }
        };
      personDataProvider.addDataDisplay(personTable);
  </code></pre>
  
  <p>...</p>
  
  <pre><code>private void fetch(final int start) {
      lastFetch = start;
      requestFactory.personRequest().getPeople(start, numRows).fire(new Receiver&lt;List&lt;PersonProxy&gt;&gt;() {
          @Override
          public void onSuccess(List&lt;PersonProxy&gt; response) {
              if (lastFetch != start){
                  return;
              }               
              int responses = response.size();
  
              if (start &gt;= (personTable.getRowCount()-numRows)){                  
                  PersonProxy newP = requestFactory.personRequest().create(PersonProxy.class);
                  response.add(newP);
                  responses++;
              }
  
              personTable.setRowData(start, response);
  
              personPager.setPageStart(start);
          }
      });     
      requestFactory.personRequest().countPersons().fire(new Receiver&lt;Integer&gt;() {
          @Override
          public void onSuccess(Integer response) {
              personTable.setRowCount(response+1, true);
          }
      });
  }
  </code></pre>
  
  <p>I try to insert last object a new empty object. And when user would fill it, I'd insert new one after it. But the code is not working. I says that user is "attempting" to edit a object previously edited by another RequestContext.</p>
  
  <p>Dilemmas:<br>
  * am I creating too many context'es?<br>
  * how to properly insert new object into celltable, created on the client side?<br>
  * on fieldUpdater when I get an editable object - should I insert it back to table or forget about it?<br></p>
  
  <p>Thanks for any help.</p>