PDA

View Full Version : [FIXED] ListStore loader listener not removing



ctblackm
7 Jul 2009, 8:03 AM
In the ListStore source in gxt-2.0-m2 in the sort method on lines 360 - 379 (which I have pasted below), a listener is being added to the loader to handle the load event (on line 368) which is never being removed due to lines 363 and 372 removing the Sort event (which the loader never fires) instead of the Load event.

-- Chris Blackmon

if (loader != null && loader.isRemoteSort()) {
Listener<LoadEvent> l = new Listener<LoadEvent>() {
public void handleEvent(LoadEvent le) {
loader.removeListener(Sort, this);
sortInfo = le.<ListLoadConfig> getConfig().getSortInfo();
fireEvent(Sort, createStoreEvent());
}
};
loader.addListener(Loader.Load, l);
loader.setSortDir(sortDir);
loader.setSortField(field);
if (!loader.load()) {
loader.removeListener(Sort, l);
sortInfo.setSortField(prev.getSortField());
sortInfo.setSortDir(prev.getSortDir());
}
} else {
applySort(false);
fireEvent(DataChanged, createStoreEvent());
}

sven
10 Jul 2009, 7:48 AM
Fixed in SVN.