cyChop
16 Dec 2010, 6:21 AM
Hi!
Little glitch we found by chance...
The ReadOnly attribute does not take all controls into account for ComboBoxes. When ReadOnly, it is still possible to make the droplist expand and select a new value by using the arrows on the keyboard (down to expand, then navigate with arrows, and return to select value).
No problem when the field is disabled, though, but it cannot be focused, so I don't know if it helps.
Still here if I can provide more intel, but I think I've already given all I could.
GXT version: 2.1
Bug was discovered in web mode, host mode was not tested.
Browser: FireFox 3.6.13
OS: Windows XP SP2
Sample code:
package lu.baloise.ecm.front.client.ui;
import java.util.ArrayList;
import java.util.List;
import com.extjs.gxt.ui.client.data.BaseModelData;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.google.gwt.user.client.Element;
public class TestUI extends LayoutContainer {
@Override
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
// dummy store
List<ModelData> dummies = new ArrayList<ModelData>();
dummies.add(this.dummyModel("Sample 1"));
dummies.add(this.dummyModel("Sample 2"));
dummies.add(this.dummyModel("Sample 3"));
dummies.add(this.dummyModel("Sample 4"));
ListStore<ModelData> store = new ListStore<ModelData>();
store.add(dummies);
// make the comboBox
ComboBox<ModelData> combo = new ComboBox<ModelData>();
combo.setStore(store);
combo.setTriggerAction(TriggerAction.ALL);
combo.setReadOnly(true);
combo.setDisplayField("property");
// adding combo to panel
this.add(combo);
}
public ModelData dummyModel(String str) {
ModelData data = new BaseModelData();
data.set("property", str);
return data;
}
}
Little glitch we found by chance...
The ReadOnly attribute does not take all controls into account for ComboBoxes. When ReadOnly, it is still possible to make the droplist expand and select a new value by using the arrows on the keyboard (down to expand, then navigate with arrows, and return to select value).
No problem when the field is disabled, though, but it cannot be focused, so I don't know if it helps.
Still here if I can provide more intel, but I think I've already given all I could.
GXT version: 2.1
Bug was discovered in web mode, host mode was not tested.
Browser: FireFox 3.6.13
OS: Windows XP SP2
Sample code:
package lu.baloise.ecm.front.client.ui;
import java.util.ArrayList;
import java.util.List;
import com.extjs.gxt.ui.client.data.BaseModelData;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.google.gwt.user.client.Element;
public class TestUI extends LayoutContainer {
@Override
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
// dummy store
List<ModelData> dummies = new ArrayList<ModelData>();
dummies.add(this.dummyModel("Sample 1"));
dummies.add(this.dummyModel("Sample 2"));
dummies.add(this.dummyModel("Sample 3"));
dummies.add(this.dummyModel("Sample 4"));
ListStore<ModelData> store = new ListStore<ModelData>();
store.add(dummies);
// make the comboBox
ComboBox<ModelData> combo = new ComboBox<ModelData>();
combo.setStore(store);
combo.setTriggerAction(TriggerAction.ALL);
combo.setReadOnly(true);
combo.setDisplayField("property");
// adding combo to panel
this.add(combo);
}
public ModelData dummyModel(String str) {
ModelData data = new BaseModelData();
data.set("property", str);
return data;
}
}