Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Filter column values using custom FILTER_DISPLAY_CONVERTER
Filter column values using custom FILTER_DISPLAY_CONVERTER [message #1805186] Tue, 09 April 2019 13:40 Go to next message
Nikolai Chebanov is currently offline Nikolai ChebanovFriend
Messages: 2
Registered: April 2019
Junior Member
I'm trying to use FILTER_DISPLAY_CONVERTER to filter values using custom DisplayConverter impelmentation. Problem which I have is that when I use DefaultGlazedListsFilterStrategy for filtering, it uses DisplayConverter to get value from the filter cell(user entered data to filter).
Issue here is that this cell contains String Object and not Object which is expected for this column. And when DefaultGlazedListsFilterStrategy tries to get value from filter cell using provided DisplayConverter it fails, as this value is always of type String.
And as result this line of code:
"String filterText = getStringFromColumnObject(columnIndex, mapEntry.getValue();" always returns empty String.
Re: Filter column values using custom FILTER_DISPLAY_CONVERTER [message #1805379 is a reply to message #1805186] Fri, 12 April 2019 20:09 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2704
Registered: July 2012
Senior Member
Sorry but I don't understand what your problem is. Did you have a look at our examples? I'm pretty sure we have an example showing the usage.
Re: Filter column values using custom FILTER_DISPLAY_CONVERTER [message #1805802 is a reply to message #1805379] Wed, 24 April 2019 12:23 Go to previous messageGo to next message
Nikolai Chebanov is currently offline Nikolai ChebanovFriend
Messages: 2
Registered: April 2019
Junior Member
Yes, I checked provided examples.
Question is not how to use Filters or DisplayConverter, in my previous message I wanted to explain what is a problem in existing implementation of DefaultGlazedListsFilterStrategy .
I will try to simplify it: In case when user enters data for filtering it is always String, or am I wrong?
But when DefaultGlazedListsFilterStrategy is used for filtering, it applies DisplayConverter(could be custom one) for the entered value(which is always String).
Thereby passes String object to DisplayConverter, which was expecting to be custom user type and not String.
Re: Filter column values using custom FILTER_DISPLAY_CONVERTER [message #1805819 is a reply to message #1805802] Wed, 24 April 2019 18:52 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2704
Registered: July 2012
Senior Member
I still don't understand your problem. Please have a look at the _6032_GlazedListsFilterCustomTypesExample. There you can see that the same converter is registered as FILTER_DISPLAY_CONVERTER and DISPLAY_CONVERTER in the filter row and the body. The DefaultGlazedListsFilterStrategy compares the string representations. So IMHO everything works as intended.
Previous Topic:Display loading state in table
Next Topic:Filtering combo box filtering
Goto Forum:
  


Current Time: Fri Aug 23 00:55:19 GMT 2019

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

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

Back to the top