Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 459643

Summary: Highlighting misbehaviour in Combo
Product: [RT] RAP Reporter: Sebastian Eckey <sebastian.eckey>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.3   
Target Milestone: 3.0 M6   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Sebastian Eckey CLA 2015-02-11 06:20:04 EST
When setting a selection on a Combo(Viewer) programmatically, in RAP the text of a combo is highlighted. It looks like as if the Combo has the Focus (the Background turns blue) but in fact the Combo does not have the Focus.

Pressing space or enter triggers the button(see snippet), pressing a letter enters the value into the combo(viewer).

Running in SWT the combo(viewer) does not get highlighted, pressing a letter does not enter the value into the combo(viewer). This is the behavior I would expect.

Bug was already reported and fixed in 1.3 (Bug 289398).
Bug can be reproduced in 2.3.1 and 3.0.0-M5
Reproducible: Always

Snippet to run:
private class TestComposite extends Composite {
 public TestComposite(final Composite parent) {
  super(parent, SWT.NONE);
  setLayout(new GridLayout(4, false));

  final Combo combo = new Combo(this, SWT.NONE);
  final Text text = new Text(this, SWT.BORDER);

  final Combo combo2 = new Combo(this, SWT.NONE);
  final Text text2 = new Text(this, SWT.BORDER);

  final Button button = new Button(this, SWT.PUSH);

  combo.setItems(new String[] { "Car", "House", "Tree", "Shoe" });
  combo2.setItems(new String[] { "Car", "House", "Tree", "Shoe" });

  combo.select(new Random().nextInt(4));
  combo2.select(new Random().nextInt(4));

  button.setText("Switch Selection");
  button.addSelectionListener(new SelectionAdapter() {		
    @Override
    public void widgetSelected(SelectionEvent e) {
     int index = combo.getSelectionIndex();

     combo2.select(index < 3 ? index + 1 : index - 3);
     combo.select(index < 3 ? index + 1 : index - 3);
     text.setText(combo.getText());
     text2.setText(combo.getText());
   }
  });
 }
}
Comment 1 Ivan Furnadjiev CLA 2015-02-11 06:55:54 EST
The client-side Combo widget was completely rewritten in RAP 2.3. The issue will be fixed in RAP 3.0M6.
Comment 2 Ivan Furnadjiev CLA 2015-02-11 08:16:38 EST
Fixed with change https://git.eclipse.org/r/#/c/41610/