I am populating a DataGrid in GWT on a button click. It is working fine but if I try to re-populate it, the data gets appended to the existing table.
I am using UI Binder/GWT 2.5 to create DataGrid.
I have already tried this:
// My list which gets updated with the response of RPC. Initially it is empty.
List<List<String>> tableRowData = new ArrayList<List<String>>();
grid.setRowCount(0); // Clears all data.
grid.setRowCount(tableRowData.size(), true); // Set the size of the new data.
grid.setRowData(0, tableRowData); // Set the new data.
Populate tableRowData...
Populate data grid // works perfect
Also since GWT 2.1.1, there is a new method setRowData(List)
Each element of the list tableRowData is again a list of strings. Is it even possible without
using ListDataProvider. For first time it works perfect, though.
Can anyone please point out what I am missing.
Thanks