I'm using SmartGWT 2.2.
I'm having some trouble with the ListGrid.invalidateCache() method. The situation is that I have a ListGrid that I populate with data, all good. At a certain point, I want to refresh that list, forcing a re-read from the database. After the re-read is completed, I want to take some action (ie., selecting a record, disabling some other controls, etc.).
As far as I know, there are two possible approaches:
This will empty the cached ResultSet, and do a new fetch from the database. Great, this works - but it has no callback, so I can't take any action on the completion of the fetch.
The second approach is:
This approach has a callback...but it's not working. I can see (from response times) that despite the setData((RecordList)null), the data set isn't really getting emptied, because the fetchData isn't going to the database. And the callback is never invoked (presumably because it's not going to the database?).
Am I doing something obvious wrong?
Thanks for any help.
I'm having some trouble with the ListGrid.invalidateCache() method. The situation is that I have a ListGrid that I populate with data, all good. At a certain point, I want to refresh that list, forcing a re-read from the database. After the re-read is completed, I want to take some action (ie., selecting a record, disabling some other controls, etc.).
As far as I know, there are two possible approaches:
Code:
invalidateCache()
The second approach is:
Code:
setData((RecordList)null); fetchData(new Criteria(), new FetchCallBack());
Am I doing something obvious wrong?
Thanks for any help.
Comment