Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Combine Excel-like filters and drop-down lists with text search in the same table(The ComboBoxFilterRowHeaderComposite seems to have problems when we try to replace the CellEditor for some columns)
Combine Excel-like filters and drop-down lists with text search in the same table [message #1851636] Mon, 11 April 2022 14:21 Go to next message
Dietrich Travkin is currently offline Dietrich TravkinFriend
Messages: 13
Registered: July 2009
Junior Member
I implemented a tabular view based on NatTable. I use the ComboBoxFilterRowHeaderComposite for filtering the content and it works fine as long as I use the drop-down lists for each column. But for some columns, I prefer to use a text search field instead of the drop-down list. Unfortunately, that seems not to work.

I added a custom configuration that replaces ComboBoxFilterRowHeaderComposite 's default cell editor with a FilterRowTextCellEditor for the desired column index, but I have the following problems: (a) I still see the little triangle that is used for columns with drop-down lists instead of the filter icon. (b) If I try to edit the text field, I see the text entry "SELECT_ALL". (c) If I enter any text contained in the column, all column entries disappear. The filter does not work properly.

My confuguration code snippet:
    int descriptionColumnIndex = indexOfColumn( ColumnConstants.COLUMN_DESCRIPTION, columnHeaderDataProvider );
    if (descriptionColumnIndex != INDEX_NOT_FOUND ) {
      configRegistry.registerConfigAttribute(
          EditConfigAttributes.CELL_EDITOR,
          new FilterRowTextCellEditor(),
          DisplayMode.NORMAL,
          FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX
              + descriptionColumnIndex);
    }


Am I doing something wrong or can ComboBoxFilterRowHeaderComposite not be used with FilterRowTextCellEditors?
Is there a simple way to debug the configuration, layers' behaviour, etc.?
Re: Combine Excel-like filters and drop-down lists with text search in the same table [message #1851638 is a reply to message #1851636] Mon, 11 April 2022 14:30 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
The two filter mechanism can not be combined at the moment. At least not out of the box. The reason is that the filtering logic in the back is different whether you select explicit items from a dropdown or if you filter free text. Technically it would be possible, but that would be some work to get the two approaches work in combination.

For debugging we have the DebugMenuListener that opens a dialog with some information like labels etc. Not sure if this is what you are searching for.
Re: Combine Excel-like filters and drop-down lists with text search in the same table [message #1851652 is a reply to message #1851638] Mon, 11 April 2022 18:41 Go to previous messageGo to next message
Dietrich Travkin is currently offline Dietrich TravkinFriend
Messages: 13
Registered: July 2009
Junior Member
Thank you for answering so quickly.

Do you mean, I would have to replace the ComboBoxFilterRowHeaderComposite and some other related classes with another implementation to make it work? I think, I'm not familiar enough with NatTable's internals to do that. Maybe that could be a feature for some of the next releases? :-)

Yes, I think, the DebugMenuListener is exactly what I was looking for.

Best regards.
Dietrich Travkin
Re: Combine Excel-like filters and drop-down lists with text search in the same table [message #1851655 is a reply to message #1851652] Tue, 12 April 2022 04:14 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Quote:
Do you mean, I would have to replace the ComboBoxFilterRowHeaderComposite and some other related classes with another implementation to make it work?


Yes, the filter strategy, the composite etc. needs to be extended/modified to support a mixture of the two approaches.

Quote:
I think, I'm not familiar enough with NatTable's internals to do that. Maybe that could be a feature for some of the next releases? :-)


Well, if you have the resources to sponsor such a feature, that would be possible.
Previous Topic:Column Width Listener
Next Topic:Highlight Row reorder swapping of rows
Goto Forum:
  


Current Time: Sat Apr 20 02:41:45 GMT 2024

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

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

Back to the top