Bug 572635

Summary: ComboBoxes with single select and checkboxes do not work reliably
Product: [Technology] NatTable Reporter: Louis Detweiler <greg.detweiler42>
Component: CoreAssignee: Dirk Fauth <dirk.fauth>
Status: CLOSED FIXED QA Contact: Dirk Fauth <dirk.fauth>
Severity: normal    
Priority: P3 CC: dirk.fauth, dirk.fauth
Version: 2.0.0   
Target Milestone: 2.0.1   
Hardware: All   
OS: Windows 10   
See Also: https://git.eclipse.org/r/c/nattable/org.eclipse.nebula.widgets.nattable/+/179962
https://git.eclipse.org/c/nattable/org.eclipse.nebula.widgets.nattable.git/commit/?id=9987f2bf26363f0418e3882747b1bf241b83db8b
https://git.eclipse.org/r/c/nattable/org.eclipse.nebula.widgets.nattable/+/180274
https://git.eclipse.org/c/nattable/org.eclipse.nebula.widgets.nattable.git/commit/?id=b11a12fd71bddad68c236c36aef7ece2358bf23a
Whiteboard:
Attachments:
Description Flags
Video of the bug in a modified NatTable examples application none

Description Louis Detweiler CLA 2021-04-06 23:00:55 EDT
Created attachment 286051 [details]
Video of the bug in a modified NatTable examples application

If you have a ComboBox Cell Editor that uses Checkboxes and also is single select instead of multi select, the editor does not reliably change the value to what is selected, even when making sure to click within the check boxes. It works sometimes on Windows, but our Mac users report that it never works on Macs.

The attached video demonstrates the behavior on Windows, with the EditorExample in the package org.eclipse.nebula.widgets.nattable.examples.examples._110_Editing, changed so that the ComboBox Cell Editor in the City column uses Checkboxes and is single select.
Comment 1 Louis Detweiler CLA 2021-04-06 23:09:25 EDT
Given Dirk's suggestion on this forum post, https://www.eclipse.org/forums/index.php/m/1840115/#msg_1840115, I believe our team will attempt to solve the issue fairly soon, and if we solve it we would be happy to contribute the solution to NatTable.
Comment 2 Eclipse Genie CLA 2021-04-29 01:10:08 EDT
New Gerrit change created: https://git.eclipse.org/r/c/nattable/org.eclipse.nebula.widgets.nattable/+/179962
Comment 3 Dirk Fauth CLA 2021-04-29 01:14:33 EDT
As there was no action I looked into this issue myself. I have created a Gerrit patch. Would be great if you could have a look and let me know if this fixes the issue for you. Also if there is no regression on the other possible use cases:

- single select without checkbox
- multi select with checkboxes
- multi select without checkboxes

Let me know if you need a SNAPSHOT build for the verification. Then I can merge the change if the verification build succeeds. My tests where successfull, but there are probably more use cases of the NatCombo than I am really aware of.
Comment 4 Louis Detweiler CLA 2021-04-29 01:50:13 EDT
(In reply to Dirk Fauth from comment #3)
> As there was no action I looked into this issue myself. I have created a
> Gerrit patch. Would be great if you could have a look and let me know if
> this fixes the issue for you. Also if there is no regression on the other
> possible use cases:
> 
> - single select without checkbox
> - multi select with checkboxes
> - multi select without checkboxes
> 
> Let me know if you need a SNAPSHOT build for the verification. Then I can
> merge the change if the verification build succeeds. My tests where
> successfull, but there are probably more use cases of the NatCombo than I am
> really aware of.

This was the exact solution we had found on Windows, however our Mac users noted that it still did not fix the issue on Macs.

I don't have a Mac so a different developer took up the task, and determined that it was because of an issue with the firing of mouse up events and selection events.

Apparently it was solved by notifying the NatCombo of a mouse up event at the end of the widgetSelected method of the selection listener. This fix was discovered today, but I felt like it was too much of a hack to contribute to the actual NatTable code. I don't have a Mac but I could ask my fellow developers if they could check your change. We do have some customizations to the NatCombo so the Mac issue could have stemmed from that I guess.

But basically, as long as the single select check box dropdowns work on a Mac with this change, then all of the testing I have already done would support that this does indeed fix the issue.
Comment 5 Dirk Fauth CLA 2021-04-29 02:11:49 EDT
IIRC the issue with mouse interactions and selection handling is that it has a different ordering. At least from menus I know this when I fixed some issues with menu contributions in E4. While on Windows and Mac for example first the selection is handled and then the menu is closed, on Mac the menu is first closed and then the selection is triggered. Or at least it was something similar.

You could give that direction an try and verify in which order the selection and mouse up handling is processed on Windows and on Mac. Maybe this gives you some hints on the issue if it still persists.
Comment 7 Eclipse Genie CLA 2021-05-06 00:37:05 EDT
New Gerrit change created: https://git.eclipse.org/r/c/nattable/org.eclipse.nebula.widgets.nattable/+/180274
Comment 9 Dirk Fauth CLA 2021-06-07 06:51:34 EDT
Released with 2.0.1