Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Filtering clarifications
Filtering clarifications [message #1786996] Thu, 17 May 2018 04:05 Go to next message
Sowmya Muniyappa is currently offline Sowmya MuniyappaFriend
Messages: 6
Registered: July 2017
Junior Member
Hello ,

I am facing two issues with filtering below i am giving a brief description for it kindly help me out to resolve it:

1)We have 3 columns with only possible data being + and - .I have added a combo filter to filter + and - .Filter works fine when for below combinations:
a) +,+ and -
b) -,- and +

where as when i apply the below combinations it doesn't work:
c) -,+ and +
d) +,- and +
e) -,+ and -
f) +,- and -
(In other words i feel there is a issue with already applied filter data value)
screenshot1.GIF attached

Filter Configurations added is given below :
ICellEditor comboBoxCellEditor = new ComboBoxCellEditor(
Arrays.asList(PLUSMINUS.PLUS.getOperator(), PLUSMINUS.MINUS.getOperator()));
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, comboBoxCellEditor, DisplayMode.NORMAL,
FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 19);
configRegistry.registerConfigAttribute(FilterRowConfigAttributes.TEXT_MATCHING_MODE, TextMatchingMode.EXACT,
DisplayMode.NORMAL, FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 19);

comboBoxCellEditor = new ComboBoxCellEditor(Arrays.asList("+", "-"));
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, comboBoxCellEditor, DisplayMode.NORMAL,
FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 20);

ICellEditor comboBoxCellEditor1 = new ComboBoxCellEditor(
Arrays.asList(PLUSMINUS1.PLUS1.getPm1(), PLUSMINUS1.MINUS1.getPm1()));
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, comboBoxCellEditor1,
DisplayMode.NORMAL, FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 21);
configRegistry.registerConfigAttribute(FilterRowConfigAttributes.TEXT_MATCHING_MODE, TextMatchingMode.EXACT,
DisplayMode.NORMAL, FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 21);


2)I want to add custom filtering strategy along with the standard filtering support which comes from DefaultGlazedListsFilterStrategy how can that be achieved ?Firstly I want to understand is it possible if yes kindly clarify.
screenshot2.GIF attached
Re: Filtering clarifications [message #1786997 is a reply to message #1786996] Thu, 17 May 2018 04:51 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2624
Registered: July 2012
Senior Member
1) I suppose you run into a bug in NatTable 1.5. There a mechanism was contributed to increase the filter performance for multiple filter criterias, but for equal values the caching is not working correctly. We fixed that in the development branch which we hopefully soon will release as 1.6.
2) There is no concept for adding a custom filter strategy. You can only implement your own, probably extending the DefaultGlazedListsFilterStrategy and use that. That is of course possible and used by several users.
Re: Filtering clarifications [message #1786998 is a reply to message #1786997] Thu, 17 May 2018 05:14 Go to previous messageGo to next message
Sowmya Muniyappa is currently offline Sowmya MuniyappaFriend
Messages: 6
Registered: July 2017
Junior Member
Thanks a ton for a quick response.
I will implement the second clarification based on your suggestions
Re: Filtering clarifications [message #1787778 is a reply to message #1786998] Wed, 30 May 2018 14:04 Go to previous messageGo to next message
Sowmya Muniyappa is currently offline Sowmya MuniyappaFriend
Messages: 6
Registered: July 2017
Junior Member
Hello Dirk,

I am trying to achieve custom filtering by following code:

CustomMatcherEditor:
EmptyMatcherEditor<SmdData> matcherEditors = new EmptyMatcherEditor<>(accessor, 31);


CompositeMatcherEditor<SmdData> compositeMatcherEditor = new CompositeMatcherEditor<SmdData>();
compositeMatcherEditor.getMatcherEditors().add(matcherEditors);

FilterRowHeaderComposite filterRowHeaderLayer = new FilterRowHeaderComposite(
new DefaultGlazedListsFilterStrategy(filterList, compositeMatcherEditor, accessor, configRegistry),
columnGroupHeaderLayer, columnHeaderDataLayer.getDataProvider(), configRegistry);

I have put some some println statements in the EmptyMatcherEditor which gives me a indication that configuration is quiet OK but the rows are not getting filtered accordingly .Kindly help me out and let me know if i am missing anything.
Thanks in advance.
Re: Filtering clarifications [message #1788120 is a reply to message #1787778] Wed, 30 May 2018 15:52 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2624
Registered: July 2012
Senior Member
I don't understand what you are trying to achieve? Static filtering additional to the filter row or something else?
Re: Filtering clarifications [message #1789555 is a reply to message #1788120] Thu, 31 May 2018 02:30 Go to previous messageGo to next message
Sowmya Muniyappa is currently offline Sowmya MuniyappaFriend
Messages: 6
Registered: July 2017
Junior Member
Dirk i am trying to add some custom filters for the columns .Below is the snapshot for the same.
Kindly give me hints on how to get this done .https://www.eclipse.org/forums/index.php?t=getfile&id=32837&
Re: Filtering clarifications [message #1789868 is a reply to message #1789555] Thu, 31 May 2018 06:08 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2624
Registered: July 2012
Senior Member
You need to implement a custom IFilterStrategy where you evaluate the value and set your matcher for that value.
Re: Filtering clarifications [message #1789869 is a reply to message #1789868] Thu, 31 May 2018 06:31 Go to previous messageGo to next message
Sowmya Muniyappa is currently offline Sowmya MuniyappaFriend
Messages: 6
Registered: July 2017
Junior Member
Yes i have tried that too but in that case Nattable provided default filters does not work.
Re: Filtering clarifications [message #1789870 is a reply to message #1789869] Thu, 31 May 2018 07:00 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2624
Registered: July 2012
Senior Member
I would suggest to extend the default implementation. Have a look at our DefaultGlazedListsStaticFilterStrategy to get an idea
Previous Topic:Editable GroupBy Bug, reproduced in the Examples Application
Next Topic:Avoid Nattable selecting the first char typed in edit mode
Goto Forum:
  


Current Time: Sat Nov 17 12:42:58 GMT 2018

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

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

Back to the top