Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Setting a default Filter for a boolean column
Setting a default Filter for a boolean column [message #1818903] Wed, 01 January 2020 12:42 Go to next message
Faruk Caglar is currently offline Faruk CaglarFriend
Messages: 17
Registered: August 2019
Junior Member
Hi,

I would like to set a default filter for a boolean column within a TablePage (within execInitTable I guess), which of course could be changed by the user afterwards. Unfortunately I could not find out how I do this programmatically for boolean columns. I found the DateColumnUserState, TextColumnUserState and NumberColumnUserState which works for date, text and number columns.

How can I handle this for boolean columns?

Thanks in advance
Re: Setting a default Filter for a boolean column [message #1819555 is a reply to message #1818903] Fri, 17 January 2020 09:33 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 182
Registered: March 2010
Senior Member
Hi Faruk,

you can use the default ColumnFilterState, there is no specific one for boolean columns. For the values use 1 (true) or 0 (false).

@Override
protected void execInitTable() {
    ColumnUserFilterState state = new ColumnUserFilterState(yourColumn);
    Set<Object> values = new HashSet<>();
    values.add(1);
    state.setSelectedValues(values);
    getUserFilterManager().addFilter(state);
}


-
Claudio
Re: Setting a default Filter for a boolean column [message #1819629 is a reply to message #1819555] Sun, 19 January 2020 10:10 Go to previous message
Faruk Caglar is currently offline Faruk CaglarFriend
Messages: 17
Registered: August 2019
Junior Member
thanks Claudio!
Previous Topic:How to create a Home button
Next Topic:Maximizing the size of the form
Goto Forum:
  


Current Time: Tue Feb 18 10:16:43 GMT 2020

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

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

Back to the top