Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » List view is not updated while filtering(Using GlazedListTreeData and ITreeRowModel)
List view is not updated while filtering [message #1816851] Fri, 08 November 2019 11:48 Go to next message
Ralf Heydenreich is currently offline Ralf HeydenreichFriend
Messages: 235
Registered: July 2009
Senior Member
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 #1816855 is a reply to message #1816851] Fri, 08 November 2019 14:38 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
I am not aware of any limitations. The groupby feature is also working in combination with filtering and sorting. I suppose some error in your setup that is responsible for the issue. But hard to tell without further details.
Re: List view is not updated while filtering [message #1816867 is a reply to message #1816855] Fri, 08 November 2019 22:34 Go to previous messageGo to next message
Ralf Heydenreich is currently offline Ralf HeydenreichFriend
Messages: 235
Registered: July 2009
Senior Member
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.
Re: List view is not updated while filtering [message #1816870 is a reply to message #1816867] Sat, 09 November 2019 07:07 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Looks OK. But yoy said that you want to filter. But there is no FilterList in place. Typically it should be between the SortedList and the TreeList.
Re: List view is not updated while filtering [message #1817371 is a reply to message #1816870] Thu, 21 November 2019 10:01 Go to previous message
Ralf Heydenreich is currently offline Ralf HeydenreichFriend
Messages: 235
Registered: July 2009
Senior Member
Hm. I've just re-implemented the whole stack without tree leyer, now it works obviously.
Previous Topic:Changing the color of the freeze grid line
Next Topic:SWTBot and Nattable: wait until all pending updates are performed
Goto Forum:
  


Current Time: Fri Mar 29 10:29:46 GMT 2024

Powered by FUDForum. Page generated in 0.02254 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top