What type of DataProvider
are you using? I would use a ListDataProvider
, and keep an entry in the list for each row that you are displaying. Each entry would contain a list of values. For example, if each row in the CellTable
represents a type of stock then you'd have an entry in the data provider for each type of stock. The stock class would contain a List
, with an entry in that list for each timestamp. The Column#getValue
method would return the stock price associated with the column that is being updated. When an update is received from the server you can create a new column in the CellTable
, and add an entry to each of the lists that represent stock prices.
--Edit--
Just a note to say that you will need to know which entry in the record you want to use in the Column#getValue
method, for example, if each row represents a specific stock then there is a list of the stock price for that stock, with each entry in the list representing the price of that stock for a specific timestamp. You will need to identify the list index (i.e., column index) when you create the column ... for example:
final int columnIndex = stockCellTable.getColumnCount();
Column<Stock, String> timestampColumn = new Column<Stock, String>(new TextCell()) {
@Override
public String getValue(Stock stock) {
return stock.getPrice(columnIndex);
}
}