|Enable Filter Row, not filtering data due to conflict with matcher editor object [message #1060774]
||Tue, 28 May 2013 08:09
| SD Khan
Registered: May 2013
I have created the "TableModel" (org.eclipse.nebula.widgets.nattable.extension.builder.model.TableModel) instance and associate it with the nattable , then i have used "enable filter row" option as true, so filter appears at the top of every column and it works fine.
For custom filtering i have implemented "IFilterStrategy" interface and done following steps to get it work.
// created a filter list object
FilterList<? extends TableRow> filterList = getTable().getFilterList();
//created a matcherEditor to perform matching.
CompositeMatcherEditor<TableRow> matcherEditor = new CompositeMatcherEditor<TableRow>();
//initializing my custom filterStrategy object
filterStrategy = new XYFilterStrategy<TableRow>(matcherEditor);
//setting the matcher to filterlist.
Now, the above code works fine as well but the problem is when i use the above code and then use that built in feature of "enable filter row" then "enable filter row" doesn't work.
I have debug the problem and found that when this line executes
filter list has a new object of "CompositeMatcherEditor" but when "enable filter row" executes it pass the same old object of "CompositeMatcherEditor" that is created in the start at the time of setup layering mechanism to "DefaultGlazedListFilterStrategy" and as filter list has a different object of "CompositeMatcherEditor" assigned to it while
"DefaultGlazedListFilterStrategy" has old object so "enable filter row" stops working while my custom filtering continue to work.
Now issue is that "DefaultGlazedListFilterStrategy" and "FilterList" have different object of "CompositeMatcherEditor" at the time when "enable filter row" apply filtering, but they should be same so it can work properly along with my custom filtering.
How I can achieve this , any kind of suggestion will be appreciated.
Note:- I am using nattable builder api to create nattable.
Powered by FUDForum
. Page generated in 0.02502 seconds