We are currently using 3.0p dated March 19, 2013.
I have an issue where ResultSet.dataChanged is fired due to DataSource.updateCaches being called to insert a new record into the cache. The Handler is coded as such:
I would expect allMatchingRowsCached to return true since the server side fetch occurred prior to this add, however it returns false. This causes the code to attempt a server fetch. However, the subsequent call to getRange does not result in a server fetch.
Am I misusing the API here? At one point this code worked as I expected, but it appears something has changed.
This leads me to another question. What is the appropriate way to determine what record/s has changed in the cache? At present I just clear all data associated with the result set, and redraw everything. This is clearly inefficient and would like to optimize this behavior. At the point where DataSource.updateCaches is invoked I could implement some form of event to explicitly broadcast what changes have occured to the cache, but before I do I am wondering if I am missing something in your API that provides this feedback already. It does not appear that a ListGrid for example completely redraws when a record is added/updated/removed via the DataSource.updateCaches mechanism?
I have an issue where ResultSet.dataChanged is fired due to DataSource.updateCaches being called to insert a new record into the cache. The Handler is coded as such:
Code:
public void onDataChanged(DataChangedEvent event) { if(resultSet.allMatchingRowsCached()) { //update interface } else { resultSet.getRange(0, length); }
Am I misusing the API here? At one point this code worked as I expected, but it appears something has changed.
This leads me to another question. What is the appropriate way to determine what record/s has changed in the cache? At present I just clear all data associated with the result set, and redraw everything. This is clearly inefficient and would like to optimize this behavior. At the point where DataSource.updateCaches is invoked I could implement some form of event to explicitly broadcast what changes have occured to the cache, but before I do I am wondering if I am missing something in your API that provides this feedback already. It does not appear that a ListGrid for example completely redraws when a record is added/updated/removed via the DataSource.updateCaches mechanism?
Comment