Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Filter Lists in Columns(Filtering StringListColumns by ListEntries)
Filter Lists in Columns [message #1835859] Tue, 15 December 2020 10:46 Go to next message
Jerome HolbeinFriend
Messages: 15
Registered: June 2020
Junior Member
In our application we have multiple tables, where certain AbstractStringColumns show comma-separated lists of strings. For example:
"Anna, Bea, Christoff"
"Anne, Detlev, Erika"
...

In such cases I would want to change the functionality of the column filter to work by List-Element instead of Column-Element. Currently the filter would create a list of column elements which would create separate entries "Anna, Bea" and "Anna, Christoff". Instead I would want to have a filter list that contains "Anna", "Bea" and "Christoff" exactly once and separate. Sure, I could use the free text field, but to get an overview over the entries such an overwritten filter would still be useful and more elegant. Is that possible?

On a related note, what is the best way to display a Collection of Objects in a column anyway? We've been using AbstractStringColumns, since it allows us to use HtmlEnabled and TextWrap, but maybe there's a proposed better way, that I just don't know about. Actually being able to see and interact with the different list-elements would be great and having to double the whole row, just to separate the values of one column feels like overkill.

Cheers,

Jerome
Re: Filter Lists in Columns [message #1836693 is a reply to message #1835859] Tue, 12 January 2021 09:11 Go to previous messageGo to next message
Jerome HolbeinFriend
Messages: 15
Registered: June 2020
Junior Member
Hi,

I am bumping this in the hope of getting a response.
Is there a possibility to have some sort of ListColumn that allows me to filter the column by List-Entries? Is it possible to override the column filtering at all? Or is this only possible by creating a custom field with a custom UI?

Best regards,

Jerome
Re: Filter Lists in Columns [message #1836766 is a reply to message #1836693] Wed, 13 January 2021 13:49 Go to previous messageGo to next message
Beat Schwarzentrub is currently offline Beat SchwarzentrubFriend
Messages: 214
Registered: November 2010
Senior Member
Hi Jerome

No, this is not possible out-of-the-box. The current filter implementation treats cell contents as text, which works well for most use cases.

I see two possibilities:

(A)
Use search forms to let the user define complex filters before the data is loaded, e.g. by adding a WHERE condition to an SQL query. This has the additional benefit of saving resources, especially when handling large data sets. The downside is that it requires more interaction from the user.

(B)
Define your own column type, e.g. ListColumn. You could then override createTableHeaderMenu() and replace or extend the entire header menu for that column. By overriding TableHeaderMenu._renderFilterTable() you can customize the filter table.
Another approach would be to use a custom ColumnUserFilter. As you may have noticed, the list entries for DateColumns only consist of the year, not of each individual date value. You could try to extend the ColumnUserFilter such that it extracts the available values from your data structure.
This second approach will take some time and effort, but may be worth it if you have many of those columns and your users do lots of that kind of filtering.

Collections of objects in a single column are non-trivial and there is no out-of-the-box solution for that. I think most developers use some sort of HTML content. This works reasonably well for display purposes, but filtering, sorting, editing and exporting data poses some challenges. It is usually recommended to find other solutions, or disable the header menu for such columns.

Regards,
Beat
Re: Filter Lists in Columns [message #1836805 is a reply to message #1836766] Thu, 14 January 2021 10:50 Go to previous messageGo to next message
Jerome HolbeinFriend
Messages: 15
Registered: June 2020
Junior Member
Hi Beat,

Thank you for your explanations. Since we have multiple instances where such a column would be useful option (B) is indeed a possibility for us. Is there some sample code that I could use for orientation for implementing a custom column? To get a sense of the steps this would involve. Since this involves the UI I assume the procedure to create a custom column also changed between Scout 9 and Scout 10, correct?

Best regards,
Jerome
Re: Filter Lists in Columns [message #1836851 is a reply to message #1836805] Fri, 15 January 2021 15:40 Go to previous messageGo to next message
Beat Schwarzentrub is currently offline Beat SchwarzentrubFriend
Messages: 214
Registered: November 2010
Senior Member
There is no full "sandbox" example yet, I'm afraid. But there are already a few specialized columns in Scout that you can refer to, such as DateColumn (JsonDateColumn, DateColumn.js), BooleanColumn, IconColumn.

The main difference between Scout 9 and Scout 10 was the migration of the JavaScript code to ES6. The basic Scout concepts are still mostly the same.

Regards,
Beat
Re: Filter Lists in Columns [message #1836935 is a reply to message #1836851] Tue, 19 January 2021 09:54 Go to previous message
Jerome HolbeinFriend
Messages: 15
Registered: June 2020
Junior Member
Okay, I will try my best going from there.

Thanks and best regards,
Jerome
Previous Topic:Display Jobs in Table
Next Topic:Session Timeout nach Tomcat Deployment
Goto Forum:
  


Current Time: Mon Nov 04 02:00:43 GMT 2024

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

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

Back to the top