Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 273769 - Radio selection events work wrong
Summary: Radio selection events work wrong
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.2   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: 1.2 RC1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-27 01:40 EDT by Igor Pavlenko CLA
Modified: 2009-05-08 08:35 EDT (History)
0 users

See Also:


Attachments
Patch for this issue (4.85 KB, text/plain)
2009-04-27 02:05 EDT, Igor Pavlenko CLA
ruediger.herrmann: iplog+
Details
Test case (2.59 KB, patch)
2009-04-27 04:06 EDT, Rüdiger Herrmann CLA
no flags Details | Diff
Test case (3.86 KB, patch)
2009-04-27 04:35 EDT, Rüdiger Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Pavlenko CLA 2009-04-27 01:40:23 EDT
There is a bug with radios. The radio selection events work wrong. The selected event sometimes fires before the unselection event.

Comment for developers:

Look, for example, at org.eclipse.jface.preference.RadioGroupFieldEditor. Find line 267. You will see, that some selection event listener is added to all of the radios in group. How it should work? The user selects the radio. The old selected radio becomes an unselected (first selection event). The new radio becames selected (second selection event).

As you can see in RadioGroupFieldEditor#267 the order of this two events does matter (unselect - the first, select - the second). It is working fine on RCP, But it works wrong on RAP. The problem is in org.eclipse.swt.internal.widgets.WidgetTreeVisitor#accept method. As you can see the WidgetTreeVisitor#accept method will be called for each item in the collection of siblings in that order in wich they was added there. So if you have 4 radios and the last one is selected and you try to select the third (or second or first) one the selected event will process before the unselected event.

It is incorrect.
Comment 1 Igor Pavlenko CLA 2009-04-27 02:05:14 EDT
Created attachment 133292 [details]
Patch for this issue

This patch adds a DeselectionEvent and registers this event in TypedEvent.
Comment 2 Rüdiger Herrmann CLA 2009-04-27 04:06:45 EDT
Created attachment 133304 [details]
Test case
Comment 3 Rüdiger Herrmann CLA 2009-04-27 04:35:59 EDT
Created attachment 133309 [details]
Test case

Ensures that the event oder is correct (de-selection events first) for typed and untyped events
Comment 4 Rüdiger Herrmann CLA 2009-05-08 08:34:36 EDT
Thanks for the patch, Igor. Changes are in CVS HEAD