Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Using Filterator and RowHideShowLayer together
Using Filterator and RowHideShowLayer together [message #1196452] Tue, 19 November 2013 12:26 Go to next message
Pradyumna Bhide is currently offline Pradyumna BhideFriend
Messages: 18
Registered: August 2013
Junior Member
Hello experts,

I am using NatTable since i have to render a large data set.
I need to support a couple of features which seem to be mutually conflicting from implementation perspective.
1. I have to provide a text box which should help users filter rows in the Nattable. I successfully implmented this by creating a "Filterator".
2. I also need to provide a checkbox which will be responsible for hiding/showing some rows from the table. I have implemented this with the help of RowHideShowLayer. Whenever I need to hide rows, I loop through the entire data set and identify the positions of row that need to be hidden and provide these to the "hideRowPositions" method the RowHideShowLayer. This works fine except in case when i sort the data when rows are hidden. I am not sure of the appropriate way to tackle this but I plan to handle this by adding an event listener that will hide rows based on the resultant positions.

Both these features work as expected in isolation. However when clubbed, the latter works as expected (with the glitch mentioned above) but the former doesn't. In the first case whenever I type anything in the filter text box all rows are hidden instead of those not matching the text in the filter textbox.
If I stop hiding rows using "RowHideShowLayer" this issue disappers.
I don't have any clue how to handle this.
Please help.

Thanks and regards,
Pradyumna
Re: Using Filterator and RowHideShowLayer together [message #1196490 is a reply to message #1196452] Tue, 19 November 2013 12:48 Go to previous messageGo to next message
Dirk Fauth is currently online Dirk FauthFriend
Messages: 2702
Registered: July 2012
Senior Member
Are you using GlazedLists for filtering? Do you use the FilterRow?

The issue is that the RowHideShowLayer is doing a transformation on what it sees. The FilterList from GlazedLists also performs a transformation on the content. Doing the transformation with the FilterList will give the RowHideShowLayer an already transformed state that does not match the state you are requesting.

We had a similar request and created the DetailGlazedListsEventLayer that directly transforms all ListChange events from GlazedLists to the NatTable layer stack. This way in NatTable those transformations can be handled. But you need to use the GlazedListsRowHideShowLayer in conjunction, as this is the row hide/show layer that works in combination with the FilterList.
Re: Using Filterator and RowHideShowLayer together [message #1196516 is a reply to message #1196490] Tue, 19 November 2013 13:03 Go to previous messageGo to next message
Pradyumna Bhide is currently offline Pradyumna BhideFriend
Messages: 18
Registered: August 2013
Junior Member
Thanks Dirk for the quick reply.
I am using GlazedLists.FilterList for filtering in the first case - i think that is what you meant by "GlazedLists for filtering".
I am not using the FilterRow.
Unfortunately the NatTable jar that we are using doesn't include GlazedListsEventLayer. Is there an alternate way to do this?
Also, is there a better solution than the one i had mentioned earlier to keep rows hidden even after they are sorted?

Regards,
Pradyumna

[Updated on: Tue, 19 November 2013 13:10]

Report message to a moderator

Re: Using Filterator and RowHideShowLayer together [message #1196526 is a reply to message #1196516] Tue, 19 November 2013 13:09 Go to previous messageGo to next message
Dirk Fauth is currently online Dirk FauthFriend
Messages: 2702
Registered: July 2012
Senior Member
Quote:
the NatTable jar that we are using


You are using a JAR and not the update site? Which version of NatTable are you using?
And of course the GlazedListsEventLayer is not part of the NatTable jar, or not, not sure what you mean in fact. There is a NatTable Core, the NatTable GlazedLists Extension and the NatTable POI Extension. What are you using?

As long as you are operating on index/position rather than id's there will be issues with that kind of use cases. With the DetailGlazedListsEventLayer and the other layers I mentioned above we tried to provide a suitable workaround. For example, if you are also sorting using the SortedList from GlazedLists, you would receive the change event and the transformation would be performed automatically.
Re: Using Filterator and RowHideShowLayer together [message #1196543 is a reply to message #1196526] Tue, 19 November 2013 13:16 Go to previous messageGo to next message
Pradyumna Bhide is currently offline Pradyumna BhideFriend
Messages: 18
Registered: August 2013
Junior Member
Yes we are using jars and i guess these are pretty old ones - "net.sourceforge.nattable..." ones. I expect that class to be in the glazedlists extension.
So if i understand it right i have to upgrade to the latest jars to get a fix for this case.
I will talk to our administrators and see if we can do so.

Thanks for your help.

Regards,
Pradyumna
Re: Using Filterator and RowHideShowLayer together [message #1196545 is a reply to message #1196543] Tue, 19 November 2013 13:20 Go to previous messageGo to next message
Dirk Fauth is currently online Dirk FauthFriend
Messages: 2702
Registered: July 2012
Senior Member
You definitely should, the codebase you are talking about is quite old, contains several bugs and is not supported anymore.
Re: Using Filterator and RowHideShowLayer together [message #1196595 is a reply to message #1196545] Tue, 19 November 2013 13:47 Go to previous message
Pradyumna Bhide is currently offline Pradyumna BhideFriend
Messages: 18
Registered: August 2013
Junior Member
Ok. Thanks. I will try my best to get the latest one.
Previous Topic:Using wildcards in configLabels
Next Topic:SetText in Corner
Goto Forum:
  


Current Time: Mon Aug 19 13:28:59 GMT 2019

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

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

Back to the top