Hi Rafael,
thank you for offering me your solution.
But in the meantime I found a very simple solution:
The application has to set the new range *before* a call to updateRowCount is made!
The first thing I do right after the data source (chat room) changed is to load the new row count.
But *before* passing this new row count to the data provider (which would trigger an onRangeChange event then), I set the range myself to a valid interval.
Finally, *after* this, I call updateRowCount.
Pseudocode:
void onSelectChatRoom:()
{
loadNewRowCount ();
}
void onLoadNewRowCount (int cnt)
{
Range r = getLastPageRangeForCurrentRoom(cnt);
tbl.setVisibleRangeAndClearData (r,true); // triggers one onRangeChange event
pvd.updateRowCount (cnt); // does not trigger a second onRangeChange event anymore!
}
HTH
Magnus