PDA

View Full Version : Problem with GXT Combo Box in IE 8.0



myworld100us
11 Feb 2010, 6:31 PM
Events Enter Not getting Fired in IE 8.0 for ComboBox. It does not allow the value to be selected by pressing Enter Key .
However selection of values does work for mouse clicks


RpcProxy<PagingLoadResult<BaseModel>> proxy = new RpcProxy<PagingLoadResult<BaseModel>>() {
@Override
public void load(Object loadConfig, AsyncCallback<PagingLoadResult<BaseModel>> callback) {
serviceProxy.getNameByWhileChar(nameCombo.getRawValue(), (PagingLoadConfig) loadConfig, callback);
}
};


nameLoader = new BasePagingLoader<PagingLoadResult<BaseModel>>(proxy);
nameLoader.setRemoteSort(false);
naeStore = new ListStore<BaseModel>(nameLoader);
nameCombo = new ComboBox<BaseModel>();
nameCombo.setDisplayField("name");
nameCobo.setValueField("value");
nameCombo.setStore(nameStore);
nameCombo.setQueryDelay(1);
nameCombo.setMinChars(1);
nameCombo.setForceSelection(true);
nameCombo.setAllowBlank(true);
nameCombo.setAutoWidth(true);
nameCombo.setHideTrigger(true);

//This is where we add the cell Editor
CellEditor pEditor = new NameComboBoxCellEditor(nameCobo);
column.setEditor(pEditor);


//My Editor
private class NameComboBoxCellEditor extends CellEditor {
protected ComboBox<BaseModel> combo;

public NameComboBoxCellEditor(ComboBox<BaseModel> field) {
super(field);
this.combo = field;
}

@Override
public Object preProcessValue(Object value) {
if (value == null) {
return value;
}

return combo.getStore().findModel("value", (String) value);
}

@Override
public Object postProcessValue(Object value) {
if (value == null) {
return value;
}
return combo.getValue().get("value");
// return ((ModelData) value).get("value");
}

}