Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Problem with new dropdown when I click on something else
Problem with new dropdown when I click on something else [message #1090021] Mon, 19 August 2013 11:46 Go to next message
Renso Lohuis is currently offline Renso Lohuis
Messages: 44
Registered: July 2012
Member
When I open a dropdown so it shows a list with options and I click on something else (not the nattable), then the dropdown item remains open (but the options are not shown).
When I do something outside the nattable that changes the content of the nattable (like loading a different state through my own state loading system), then it tries to map the value of the dropdown on the new column. This can result in nasty null pointers. Or could set the wrong value on a column.

Does anybody has the same problem?
Does anybody has a workaround?
Should I file a bug?
Re: Problem with new dropdown when I click on something else [message #1090183 is a reply to message #1090021] Mon, 19 August 2013 16:36 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1255
Registered: July 2012
Senior Member
File a bug. Seems the focus listener is not reacting the way it should
Re: Problem with new dropdown when I click on something else [message #1090556 is a reply to message #1090183] Tue, 20 August 2013 06:02 Go to previous messageGo to next message
Renso Lohuis is currently offline Renso Lohuis
Messages: 44
Registered: July 2012
Member
I filed a bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=415459
Re: Problem with new dropdown when I click on something else [message #1090603 is a reply to message #1090556] Tue, 20 August 2013 07:41 Go to previous messageGo to next message
S G is currently offline S G
Messages: 6
Registered: August 2013
Location: Germany
Junior Member
Yesterday, I found in our natTreeTable implementation a similar problem with focus listener.

The opened TextCellEditor doesn't react of the resize of the sash (click outside the tree and resize the sash). Theoretically, the editor has to rearrange the opened editor cell.

1) TextCellEditor is opened
ttp://www.imgbox.de/users/public/images/7T2FolSZ3x.png

2) Resizing the sash --> The editor isn't rearranged.
ttp://www.imgbox.de/users/public/images/ZoaNr7LFMU.png

Sorry, for the dump links. --> "You can only use links to eclipse.org sites while you have fewer than 5 messages." Confused
Re: Problem with new dropdown when I click on something else [message #1091526 is a reply to message #1090603] Wed, 21 August 2013 12:18 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1255
Registered: July 2012
Senior Member
What do you mean with sash?

Theoretically the editor should close if you perform actions outside.
Re: Problem with new dropdown when I click on something else [message #1092058 is a reply to message #1091526] Thu, 22 August 2013 05:18 Go to previous messageGo to next message
S G is currently offline S G
Messages: 6
Registered: August 2013
Location: Germany
Junior Member
We have a PartSashContainer. In the left side is our implementation of a natTreeTable and in the right side is a simple natTable for example.

The editor is closed, when I perform an action in the natTable or natTreeTable. But if I run a other action like "any button click", "move the sash", it will not closed.

---

A workmate tells me, that this problem is in the natTable per se. If he resize the window, the editor layer remains standing.
Re: Problem with new dropdown when I click on something else [message #1092093 is a reply to message #1092058] Thu, 22 August 2013 06:21 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1255
Registered: July 2012
Senior Member
Seems resizing doesn't cause the editor control to loose focus. Could you please add a comment to the ticket. We need to investigate on this.

BTW, do you use percentage sizing? Otherwise why should the column resize when you resize the sash?
Re: Problem with new dropdown when I click on something else [message #1093067 is a reply to message #1092093] Fri, 23 August 2013 10:11 Go to previous messageGo to next message
S G is currently offline S G
Messages: 6
Registered: August 2013
Location: Germany
Junior Member
You have formulated the problem correctly. Razz
I write a comment next week monday.

Yes, I use percentage.

    @Override
    protected void configureBodyDataLayer() {
       this.getBodyDataLayer().setColumnPercentageSizing(true);
       this.getBodyDataLayer().setColumnWidthPercentageByPosition(0,45);
       this.getBodyDataLayer().setColumnWidthPercentageByPosition(1,25);
       this.getBodyDataLayer().setColumnWidthPercentageByPosition(2,30);
       this.getBodyDataLayer().setConfigLabelAccumulator(getConfigLabelAccumulator());
    }


And why?
Quote:
Otherwise why should the column resize when you resize the sash?

Why not. Wink
I use a a one column GridLayout in the left sashContainer. The setup ist a GridData, which fill the space horizontally and vertically. So every think have a relativ size, also the column width.

[Updated on: Fri, 23 August 2013 10:12]

Report message to a moderator

Re: Problem with new dropdown when I click on something else [message #1093221 is a reply to message #1093067] Fri, 23 August 2013 15:33 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1255
Registered: July 2012
Senior Member
Quote:
So every think have a relativ size, also the column width.


Using the GridLayout will only have impact on the NatTable control. The column width will only scale when using percentage sizing. As you do this, it works exactly as you describe.
Re: Problem with new dropdown when I click on something else [message #1113034 is a reply to message #1093221] Fri, 20 September 2013 10:50 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1255
Registered: July 2012
Senior Member
Puh, that one hurt my brain. But finally I hope I've found the correct solution.

1. for the resizing stuff there is currently only the solution to close the current active editor. This is the same behaviour as clicking in the NatTable or the scrollbar. Modifying the bounds of the editor control would mean too much modifications to the current code in terms of additional listeners and handlers. And for the 1.x architecture I don't want to start that. We will keep that in mind for the next architecture.

2. The focus stuff for NatCombo was really tricky, as it combines two controls that do not share the same focus. To introduce a shared focus I added a FocusListener that is added to both controls and a member variable to hold the focus state. If one control looses the focus, the member variable is set to false and a delayed background thread is started. If the other control gains focus, the background thread will not execute, because the focus stays in the NatCombo. If the other control doesn't gain the focus, the registered FocusListeners get informed.

Handling the background processing and concurrency was quite tricky, but I hope everything is working as expected now. In the EditorExample it seems to work fine.

Please let me know if you find any issues with that.
Re: Problem with new dropdown when I click on something else [message #1113054 is a reply to message #1113034] Fri, 20 September 2013 11:19 Go to previous messageGo to next message
Renso Lohuis is currently offline Renso Lohuis
Messages: 44
Registered: July 2012
Member
Great, Thanks Dirk!!!

I will use/test it when 1.1.0 is released
Re: Problem with new dropdown when I click on something else [message #1113057 is a reply to message #1113054] Fri, 20 September 2013 11:22 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1255
Registered: July 2012
Senior Member
Well testing it prior to the release would be also great to ensure that there is no new issue introduced with that. Otherwise you would need to wait for a long time to get a fix on that. Wink

If you are using a target platform definition, testing should be quite easy. You only need to change the official release site to the snapshot site. You can even do this temporarily for testing to ensure that everything works fine.

Any help in verifying those fixes would be great!
Re: Problem with new dropdown when I click on something else [message #1231300 is a reply to message #1113057] Tue, 14 January 2014 04:59 Go to previous message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1255
Registered: July 2012
Senior Member
Needed to modify the solution a bit because of side effects regarding the Excel like filter row for example. Now NatTable is listening for resizes of the parent control instead, because enabling/disabling scrollbars also cause a resize event on the NatTable.
Previous Topic:Autoresize command
Next Topic:when scroling horizontally, nattable filter stop working
Goto Forum:
  


Current Time: Sat Aug 23 01:40:50 EDT 2014

Powered by FUDForum. Page generated in 0.12880 seconds