Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » problem with column hide(reproduceable with modified example)
problem with column hide [message #1827413] Thu, 14 May 2020 08:34 Go to next message
Ludwig Moser is currently offline Ludwig MoserFriend
Messages: 476
Registered: July 2009
Senior Member
I noticed strange behaviour in my application and tried to reproduce the problem in an NatTable example (actually i expected the behaviour to be correct with the example)

My test is based on ColumnHideShowExample (which shows 10 entries)

with more than one row (this is the expected behaviour!):
select a row and then click on a column header -> hide column.
the column you clicked on gets removed.

do the same with only one row and all the columns get removed.
the same happens when you select all rows

NOTICE: the color of the column headers change a bit (they get darker, in the cases when the misbehaviour occurs)

using Nattable 1.6.0.201909181823
Re: problem with column hide [message #1827416 is a reply to message #1827413] Thu, 14 May 2020 08:59 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
This is because of the special handling of fully selected columns. The feature is that you can select multiple columns and then call "hide column". Then all fully selected columns are hidden. If you only have one row and select that row, every column is fully selected and therefore hidden.

If you have an idea how to solve your issue by still keeping the feature of multi column hide, feel free to share. That issue is known for a long time and I never got any idea how to solve this.
Re: problem with column hide [message #1827417 is a reply to message #1827416] Thu, 14 May 2020 09:04 Go to previous messageGo to next message
Ludwig Moser is currently offline Ludwig MoserFriend
Messages: 476
Registered: July 2009
Senior Member
thanks for the fast reply.

do you have a solution with dropping the multi column hide?
as if i have a row selected i will always have all columns selected - which shall never be all hidden... so this makes no sense in my case.

EDIT: and the full-select is not implemented by me - it just happens...
so i just select the row and nattable makes a full column selection.
- how can i disable this feature ?

[Updated on: Thu, 14 May 2020 09:14]

Report message to a moderator

Re: problem with column hide [message #1827424 is a reply to message #1827417] Thu, 14 May 2020 10:02 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 47
Registered: March 2020
Member
Well, the definition of a fully selected column is that all cells in a column are selected. For this the selection is inspected. One use once made the suggestion to check if a column was was fully selected by a click on the header. But I had no chance to investigate further on this.

There are several ways. You could either completely disable fully selected column behaviors by overriding SelectionLayer#isColumnPositionFullySelected() or by implementing a custom ISelectionModel that overrides the corresponding method. If you only want to avoid the multi column hide, you need to override SelectionLayer#handleColumnHideCommand() like this:

    protected boolean handleColumnHideCommand(ColumnHideCommand command) {
            return super.doCommand(command);
    }
Re: problem with column hide [message #1827427 is a reply to message #1827424] Thu, 14 May 2020 10:20 Go to previous message
Ludwig Moser is currently offline Ludwig MoserFriend
Messages: 476
Registered: July 2009
Senior Member
i just override isColumnPositionFullySelected and the result is what i expected.

again, thanks for the fast (and solving) reply!
Previous Topic:update/refresh NatTable after updating the POJO
Next Topic:Automatically Wrap the text in a Gridlayer
Goto Forum:
  


Current Time: Fri Mar 29 05:51:16 GMT 2024

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

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

Back to the top