Hi,
please review the new API we added for JIRA 2253:
https://issues.apache.org/jira/browse/TRINIDAD-2253
For table/tree/treeTable, it's very possible that some rows on the
client side may not be available in the model at server side. One
example is when the model supports ranging and range size is relatively
small. In that case, if one tries to access the row on client that's not
available in the model, issues will arise.
This enhancement is to provide the ability to synchronize the number of
rows in the model with the number of rows at client, to make sure the
model contains at least the same amount of rows as that on the client.
The model can choose how to respond to size synchronization depending on
it's own logic.
public method syncNumRows() is added to UIXCollection to initiate the
synchronization.
/**
* Synchronize the number of rows client and server cache. The server
* should keep no less what what client caches.
*
* @param numRows the number of rows client holds
*/
public void syncNumRows(int numRows)
{
getCollectionModel().syncNumRows(numRows);
}
The default implementation of syncNumRows on CollectionModel is to do
nothing.
/**
* Synchronize the number of rows client and server cache. For
collection models that
* do paging, they should keep row cache no less that what client holds.
*
* @param numRows the number of rows client holds
*/
public void syncNumRows(int numRows)
{
return;
}
Thanks,
Jing