HasValue<User>
or HasValue<TableRow>
would not work in this case, because this would only permit handling a single row.
You could maybe use a HasValue<List<User>>
but that would mean, that your view has to render the entire table on each change.
I might be wrong, but I think for tables its best to use a Supervising Presenter instead of the Passive View.
Have a look at the PagingScrollTable widget in the GWT Incubator:
public class PagingScrollTable<RowType> extends AbstractScrollTable implements
HasTableDefinition<RowType>, ... {
...
TableModel<RowType> getTableModel()
...
}
For a PagingScrollTable
, a MutableTableModel<RowType>
is used as implementation of TableModel<RowType>
.
MutableTableModel<RowType>
in turn implements the following interfaces:
HasRowCountChangeHandlers
, HasRowInsertionHandlers
, HasRowRemovalHandlers
, HasRowValueChangeHandlers<RowType>
The PagingScrollTable
registers itself as listener on the MutableTableModel
and therefore gets very fine-grained notifications of updates. The resulting implementation should be very performant.