Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 224872 - Buttons of style radio don't fire Selectionevent properly
Summary: Buttons of style radio don't fire Selectionevent properly
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.2 M6   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 250162
Blocks:
  Show dependency tree
 
Reported: 2008-03-31 07:59 EDT by Frank Appel CLA
Modified: 2009-02-11 08:36 EST (History)
0 users

See Also:


Attachments
testcase (3.43 KB, patch)
2008-08-19 05:23 EDT, Benjamin Muskalla CLA
no flags Details | Diff
Proposed patch (5.26 KB, patch)
2009-02-10 07:09 EST, Ivan Furnadjiev CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Appel CLA 2008-03-31 07:59:27 EDT
In RWT radio-buttons of the same Group behave differently regarding the selection event handling than in SWT. In SWT both buttons the one that gets selected and the one that gets unselected notify their attached selection listeners. In RWT only that one that gets selected notifies the attached selection listeners. Snippet to reproduce:

    Display display = new Display();
    Shell shell = new Shell( display, SWT.NONE );
    shell.setLayout( new FillLayout( SWT.VERTICAL ) );
    
    SelectionAdapter listener = new SelectionAdapter() {
      public void widgetSelected( final SelectionEvent evt ) {
        Button button = ( Button )evt.widget;
        String text = button.getText();
        System.out.println( text + " is selected: " + button.getSelection() );
      }
    };
    
    Button radio1 = new Button( shell, SWT.RADIO );
    radio1.setText( "button1" );
    radio1.addSelectionListener( listener );

    Button radio2 = new Button( shell, SWT.RADIO );
    radio2.setText( "button2" );
    radio2.addSelectionListener( listener );

    Button radio3 = new Button( shell, SWT.RADIO );
    radio3.setText( "button3" );
    radio3.addSelectionListener( listener );
    
    shell.setSize( 200, 200 );
    shell.open();
    
    while( !shell.isDisposed() ) {
      if( !display.readAndDispatch() ) {
        display.sleep();
      }
    }
Comment 1 Benjamin Muskalla CLA 2008-08-19 05:23:43 EDT
Created attachment 110319 [details]
testcase

testcase
Comment 2 Benjamin Muskalla CLA 2009-01-22 17:39:01 EST
I really wonder why this bug depends on bug 250162
Comment 3 Rüdiger Herrmann CLA 2009-01-23 04:23:52 EST
(In reply to comment #2)
> I really wonder why this bug depends on bug 250162
Becuase resolving bug 250162 will require a re-write of the client-side readio button. Then we are independant of qooxdoo and/or browser behavior.
Comment 4 Ivan Furnadjiev CLA 2009-02-10 07:09:10 EST
Created attachment 125226 [details]
Proposed patch
Comment 5 Ivan Furnadjiev CLA 2009-02-11 08:36:59 EST
Fixed in CVS HEAD.