title: Create GWT CellTable Dynamically
body: <p>I am stuck in a problem with GWT CellTable. I need to create celltable dynamically and I dont have entity (Bean) class to do so. I have seen all the examples of celltable and searched a lot to do so without entity class.</p>
  
  <p>I need to populate table dynamically according to some metadata stored in database. I am able create table structure </p>
  
  <p>Consider there are two classes one is GRID and another is COLUMN for the metadata and columns definition. GRID will have list of COLUMNS as a columns definition</p>
  
  <pre><code>    Class GRID {
  List&lt;COLUMN&gt; columns;
  }
  
  Class COLUMN {
    String columnName;
  }
  </code></pre>
  
  <p>Now i need to get grid from database and loop the columns to populate the cells (Columns) like :</p>
  
  <pre><code>com.google.gwt.user.cellview.client.Column&lt;String, String&gt; textColumn = new Column&lt;String, String&gt;(
                          new EditTextCell()) {
                      @Override
                      public String getValue(String object) {
                          return object;
                      }
                  };
  </code></pre>
  
  <p>Now, I need to add some data to the celltable. but without entity there are no example how to populate the different columns. I have tried my self like : <strong>(Consider Grid have 3 columns)</strong></p>
  
  <pre><code>List&lt;String&gt; data;
  
  String a1 = "A1";
              String a2 = "A2";
              String a3 = "A3";
  
              data = new ArrayList&lt;String&gt;();
              data.add(a1);
              data.add(a2);
              data.add(a3);
  
  final AsyncDataProvider&lt;String&gt; provider = new AsyncDataProvider&lt;String&gt;() {
              @Override
              protected void onRangeChanged(HasData&lt;String&gt; display) {
                  updateRowData(0, data);
              }
            };
            provider.addDataDisplay(grid);
  provider.updateRowCount(data.size(), true);
  </code></pre>
  
  <p>I am able to produce the output like :</p>
  
  <pre><code>A1 A1 A1
  
  A2 A2 A2
  
  A3 A3 A3
  </code></pre>
  
  <p>Actually output should be one row only like </p>
  
  <pre><code>A1 A2 A3
  </code></pre>
  
  <p>But failed to do so. </p>
  
  <p>Please help.</p>
  
  <p>Thankx,</p>
  
  <p>Regards,</p>