-
25 Jan 2012 2:35 AM #1
ComboBox selection is not visible
ComboBox selection is not visible
I am using gxt ComboBox , in the field drop down it is showing values, but when i select a value from the drop down list it is now visible(disappearing). Here i am using setTemplate(), is there any problem with this. Please suggest me.
Thanks in advance.
Code:
private void configureComboBox() {
templateCombo.setEmptyText("Select a state...");
templateCombo.setDisplayField("name");
templateCombo.setTemplate(getTemplate(WYGCityWithStateModel.cityField,
WYGCityWithStateModel.cityStateField));
templateCombo.setWidth(150);
templateCombo.setStore(store);
templateCombo.setTypeAhead(true);
templateCombo.setTriggerAction(TriggerAction.ALL);
}
private native String getTemplate(String stateFieldName,
String cityFieldName) /*-{
return [
'<tpl for=".">',
'<div class="x-combo-list-item">{values.' + cityFieldName
+ '} ({values.' + stateFieldName + '})</div>', '</tpl>' ]
.join("");
}-*/;
-
30 Jan 2012 6:29 AM #2
The ComboBox will display the value from difined by
templateCombo.setDisplayField("name");
I guess you don't have that property in your ModelData
Try changing to:
templateCombo.setDisplayField(WYGCityWithStateModel.cityStateField);


Reply With Quote