List view is not updated while filtering [message #1816851] |
Fri, 08 November 2019 06:48  |
Eclipse User |
|
|
|
Hi all,
I've built a List view with GlazedList and used a TreeRowModel (GlazedListTreeRowModel). Additionally, I've using a single search field where I can filter my list data. Now, if I type something in the search field the list isn't changing.
I've another list view without tree representation. Here the filtering works correctly. Are there some limitations with TreeRow model? I've debugged something around and found that the search and filter mechanism works obviously. But the event to change the list isn't processed (I think). Any hints are appreciated...
TIA,
Ralf.
|
|
|
|
Re: List view is not updated while filtering [message #1816867 is a reply to message #1816855] |
Fri, 08 November 2019 17:34   |
Eclipse User |
|
|
|
I assume it lies in the layer stack. It's built like this:
public TreeBodyLayerStack(List<K> values,
IColumnPropertyAccessor<K> columnPropertyAccessor,
TreeList.Format<K> treeFormat) {
// wrapping of the list to show into GlazedLists
// see http://publicobject.com/glazedlists/ for further information
EventList<K> eventList = GlazedLists.eventList(values);
TransformedList<K, K> rowObjectsGlazedList = GlazedLists.threadSafeList(eventList);
// use the SortedList constructor with 'null' for the Comparator
// because the Comparator will be set by configuration
SortedList<K> sortedList = new SortedList<>(rowObjectsGlazedList, null);
// wrap the SortedList with the TreeList
this.treeList = new TreeList<K>(sortedList, treeFormat, TreeList.NODES_START_COLLAPSED);
this.bodyDataProvider = new ListDataProvider<K>(this.treeList, columnPropertyAccessor);
bodyDataLayer = new DataLayer(this.bodyDataProvider);
// simply apply labels for every column by index
bodyDataLayer.setConfigLabelAccumulator(new ColumnLabelAccumulator());
// layer for event handling of GlazedLists and PropertyChanges
GlazedListsEventLayer<K> glazedListsEventLayer = new GlazedListsEventLayer<>(bodyDataLayer, this.treeList);
GlazedListTreeData<K> treeData = new GlazedListTreeData<>(this.treeList);
ITreeRowModel<K> treeRowModel = new GlazedListTreeRowModel<>(treeData);
this.selectionLayer = new SelectionLayer(glazedListsEventLayer);
this.treeLayer = new TreeLayer(this.selectionLayer, treeRowModel);
treeLayer.setRegionName(GridRegion.BODY);
setUnderlyingLayer(new ViewportLayer(this.treeLayer));
}
Is that correct or should I build it otherwise?
TIA,
Ralf.
|
|
|
|
|
Powered by
FUDForum. Page generated in 10.24972 seconds