Bug 439044 - Combo / DateTime controls in the toolbar of a view with focus don't work
Summary: Combo / DateTime controls in the toolbar of a view with focus don't work
Status: ASSIGNED
Alias: None
Product: RAP
Classification: RT
Component: Workbench (show other bugs)
Version: 2.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-07 12:26 EDT by Martin Domig CLA
Modified: 2014-07-14 07:05 EDT (History)
0 users

See Also:


Attachments
Animated gif showing the odd behaviour (220.27 KB, image/gif)
2014-07-07 12:26 EDT, Martin Domig CLA
no flags Details
Patch to the demo project adding a DateTime and a Combo to DemoTableViewPart (5.92 KB, patch)
2014-07-07 12:30 EDT, Martin Domig CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Domig CLA 2014-07-07 12:26:03 EDT
Created attachment 244858 [details]
Animated gif showing the odd behaviour

I have a DateTime (drop down) and a Combo widget in a control contribution in the toolbar of a view part. When the part has focus, and I then click on any of these controls, it looks like the following is happening:

1. the widget "reacts" on the mouse click (the drop down drops down)
2. setFocus() of the view part is called, setting focus to a control inside it
3. the widget in the control contribution looses focus:
3a - the DateTime dropdown remains visible, but won't react properly on any clicks
3b - the Combo immediately closes itself.

I've added a patch to the workbench demo as well as an animated gif that shows the behaviour.

We suspect that this problem has been around since RAP 1.4, so this is likely not new.
Comment 1 Martin Domig CLA 2014-07-07 12:30:07 EDT
Created attachment 244859 [details]
Patch to the demo project adding a DateTime and a Combo to DemoTableViewPart

Added workbench demo patch
Comment 2 Ivan Furnadjiev CLA 2014-07-14 03:05:48 EDT
I can reproduce it with your snippet.
Comment 3 Ivan Furnadjiev CLA 2014-07-14 03:14:34 EDT
BTW... does it work as you expect in RCP?
Comment 4 Martin Domig CLA 2014-07-14 05:41:10 EDT
Just tested it with the Eclipse RCP Template (RCP Appplication with a view), using the same control contribution. Works as expected.
Comment 5 Ivan Furnadjiev CLA 2014-07-14 07:05:53 EDT
RAP uses a workaround (not sure if it's still needed) for part activation in DefaultTabFolder/AbstractTabFolder - activate listener instead of mouse listener (see DefaultTabFolder#activateListener). When you click on a Combo/DateTime in view part toolbar, the toolbar is activated and event TabFolderEvent.EVENT_GIVE_FOCUS_TO_PART is fired. As a result the viewer take the focus again (WorkbenchPart#setFocus is called) and the Combo hides its list.