-
23 Jul 2009 8:14 AM #1
[1.2.4] Modified records are deleted across load operations (e.g., during paging).
[1.2.4] Modified records are deleted across load operations (e.g., during paging).
The ListStore is supposed to keep modified records across load calls but it does not
Here is the onLoad method of ListStore. the call to removeAll() deletes the records in the store...
Code:protected void onLoad(LoadEvent le) { this.config = (ListLoadConfig) le.config; Object data = le.data; removeAll(); if (data instanceof List) { List<M> list = (List) le.data; all = list; } else if (data instanceof ListLoadResult) { all = ((ListLoadResult) data).getData(); } for (M m : all) { registerModel(m); } if (le.config instanceof ListLoadConfig) { ListLoadConfig config = (ListLoadConfig) le.config; if (config.getSortInfo().getSortField() != null) { sortInfo = config.getSortInfo(); } else { sortInfo = new SortInfo(); } } if (filtersEnabled) { filtersEnabled = false; applyFilters(filterProperty); } if (storeSorter != null) { applySort(true); } fireEvent(DataChanged, createStoreEvent()); }
-
23 Jul 2009 8:25 AM #2
This is not a bug but a feature requestment. Moving this to help forum so that moer people see it.
-
23 Jul 2009 8:49 AM #3
The Store javadoc is wrong then?
The Store javadoc is wrong then?
Here's the method that made me think it was a bug:
Code:/** * Gets all records modified since the last commit. Modified records are * persisted across load operations (e.g., during paging). * * @return a list of modified records */ public List<Record> getModifiedRecords() { return new ArrayList<Record>(modified); }
-
23 Jul 2009 9:14 AM #4
Reloading a store deletes all data in it. You can extend ListStore to add this feature if you need it. However this can end up in a memoryleak. I will correct the javadoc
-
23 Jul 2009 9:35 AM #5
Anything in particular that I should look out for with regards to a memory leak?


Reply With Quote