Custom Filter issue with non string type column

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Custom Filter issue with non string type column

Postby gaolifeng » Tue Sep 06, 2016 10:07 am

Hi, I am trying to use the AutoFilterTableHeader in our tables to filter data, but having trouble with the custom filter conditions with non string columns.
No matter what the column data type is, it always show the String filters, e.g. For a Date.class type column, I am expecting to see the following conditions when open the Custom Filter Editor Dialog
Expected Date_Type_Column.png
Expected Date_Type_Column.png (22.06 KiB) Viewed 1872 times

But I always see the following conditions, seems like it is considered as a String column always.
Actual showing for Date Type Column.png
Actual showing for Date Type Column.png (17.14 KiB) Viewed 1872 times


I wonder what could be wrong with our tablemodel?
Our tableModel has the getColumnClassAt() method returns the correct date types, and our tableModel also implemented the ContextSensitiveTableModel, and has getCellClassAt() returns the correct date types.

Another question, is it possible to have less filters in the Custom Filter Editor Dialog? E.g. to only show Contains filter in the condition drop down.

Thanks,
Frank
gaolifeng
 
Posts: 7
Joined: Tue May 22, 2012 7:33 am

Re: Custom Filter issue with non string type column

Postby JIDE Support » Tue Sep 06, 2016 11:01 am

It should show different list of filters based on the data type. Could you please try to reproduce the issue by modifying AutoFilterTableHeaderDemo.java? Otherwise I can't tell what you did wrong in your code.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 36106
Joined: Sun Sep 14, 2003 10:49 am

Re: Custom Filter issue with non string type column

Postby gaolifeng » Tue Sep 06, 2016 11:30 am

Hi I am not able to reproduce the issue by using the tableModel from AutoFilterTableHeaderDemo.

final TableModel tableModel = DemoData.createProductReportsTableModel(true, 0);

Our code is the same other than this tableModel. That is why I think problem is in our tablemodel.

Our company purchased support from Jide, how can we get help on this?

Another question, is it possible to have less filters in the Custom Filter Editor Dialog? E.g. to only show Contains filter in the condition drop down.

Thanks!
gaolifeng
 
Posts: 7
Joined: Tue May 22, 2012 7:33 am

Re: Custom Filter issue with non string type column

Postby gaolifeng » Tue Sep 06, 2016 1:27 pm

I figured out what is going on.
Turned out in the jide code, it is calling ((ContextSensitiveTableModel) filterableTableModel).getCellClassAt(-1, columnIndex). trying to get -1 row's Cell Class.
And in our code, we can't get -1 row cell class and returned a default String.class.

Now can you please help me with my second question. is it possible to have less filters in the Custom Filter Editor Dialog? E.g. to only show Contains filter in the condition drop down.
Thanks!
gaolifeng
 
Posts: 7
Joined: Tue May 22, 2012 7:33 am

Re: Custom Filter issue with non string type column

Postby JIDE Support » Tue Sep 06, 2016 4:12 pm

You can do that by using FilterFactoryManager by calling unregisterFilterFactory to remove all other Filter Factories.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 36106
Joined: Sun Sep 14, 2003 10:49 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 2 guests