Hello,
I have a small chat within my chess application. The chat messages are displayed within a CellTable, which has a Pager and an AsyncDataProvider. The data provider fetches the messages from the server and pushes them into the CellTable via the onRangeChange method. So far, so good.
When the user enters a message, it is sent to the server and the whole table is reloaded by calling setVisibleRangeAndClearData. This is, what I want to change. Instead of reloading the whole table, I would like to just append the new message to the table. I managed to do this as follows:
int n = tbl.getRowCount();
pvd.updateRowData (n,lst);
pvd.updateRowCount(n+1, true);
gotoLastPage(); // !!!
scp.scrollToBottom();
The problem is that the new message may be beyond the currend page size. I want that after the append the last message is visible. But whatever I do to change the page start ("!!!" above), there is always the data provider invoked which makes a call to the server.
How can I - just in this situation - update the table without reloading it?
Is there a simple solution?
Thanks
Magnus