PDA

View Full Version : [GXT 2.1] Unable to select combobox-item



Beekman
3 Jan 2010, 6:06 AM
- Detailed description of the problem: When a ComboBox is used in a GWT-DialogBox, it is not possible to select an item with the mouse (in Firefox)... It is possible to select it using the keyboard, though...
- GXT version: 2.1
- Host mode / web mode / both
- Browser and version: FireFox 3.5
- Operating System: Windows
- Sample code:

public class Test implements EntryPoint {

/**
* This is the entry point method.
*/
public void onModuleLoad() {

DialogBox dialog = new DialogBox();
FlexTable contentPanel = new FlexTable();

List<TestString> list = new ArrayList<TestString>();
list.add(new TestString(1));
list.add(new TestString(2));
list.add(new TestString(3));

ComboBox<TestString> combo = new ComboBox<TestString>();
ListStore<TestString> store = new ListStore<TestString>();
store.add(list);
combo.setStore(store);
combo.setDisplayField("dummy");

contentPanel.setWidget(0, 0, combo);
dialog.setWidget(contentPanel);
dialog.setHTML("Test");
dialog.show();
dialog.center();
}

/**
* A testclass.
*/
private class TestString extends BaseModel {

private int i;

public TestString(int i) {
this.i = i;
}

public <X> X get(String property) {
return (X) ("Test " + i);
}

public Collection<String> getPropertyNames() {
ArrayList<String> keys = new ArrayList<String>();
keys.add("dummy");
return keys;
}
}
}

sven
3 Jan 2010, 6:15 AM
This is not a bug in GXT. I suggest to use the debugger. DialogBox captures all mouseevents.

Beekman
3 Jan 2010, 6:35 AM
Okay, thanks for the reply...
When I disable modal the problem does not occur, but that's not an option...
But I just found out the GXT-Dialog also has a (even prettier) modal-function... so I just have to rewrite the code a bit to use that instead...

Thnx...

Arno.Nyhm
5 Jan 2010, 8:15 AM
This is not a bug in GXT. I suggest to use the debugger. DialogBox captures all mouseevents.

i assume if i place some widgets in a dialog box then all widgets work as normal.

why it is done like you described?

sven
5 Jan 2010, 8:20 AM
DialogBox is a GWT component. If it is set to modal, it captures evenrything that is not target of the dialogbox element. The list is not and cannot be part of it. So it does not work.

I suggest to really use the debugger and erad the javadocs for DialogBox.


i assume if i place some widgets in a dialog box then all widgets work as normal.

You should never assume something. You need to understand what you use. If you use a feature (modal dialogbox here) than it works as described and caputres everything. There is even the possibility to add something to the ignore list. All this is documented

Arno.Nyhm
5 Jan 2010, 11:25 AM
ok - i miss the part that DialogBox comes from GWT and Dialog comes from GXT

with GXT-Dialog it is working....