SmartGWT Version used : 4.0p Dated 2013-12-23
Browsers Used : IE9 and Chrome
We are using setEditorCustomizer to display a SelectItem in a grid cell using following code snippet.
setCanEdit(true);
setModalEditing(true);
setAutoSaveEdits(true);
setAlwaysShowEditors(true);
setEditEvent(ListGridEditEvent.CLICK);
setEditByCell(true);
this.setEditorCustomizer(new ListGridEditorCustomizer() {
public FormItem getEditor(ListGridEditorContext context) {
ListGridField field = context.getEditField();
PaymentListRecord record = (PaymentListRecord) context.getEditedRecord();
if (field.getName().equals(Fields.MANAGED_SPREAD_FROM_PARENT) ){
SelectItem spreads = new SelectItem();
spreads.setShowTitle(false);
spreads.setWidth("45");
spreads.setHeight("20");
spreads.setValueMap("0", "5", "10", "20", "30" );
return spreads;
}
if (field.getName().equals(Fields.MANAGED_FEE_FROM_PARENT)) {
SelectItem fees = new SelectItem();
fees.setShowTitle(false);
fees.setWidth("45");
fees.setHeight("20");
fees.setValueMap("100", "500", "1000", "2000", "3000" );
return fees;
}
return context.getDefaultProperties();
}
});
The grid displays fine with two select items, one in 'spread' column, the other in 'fees' column. But when user tries to select a value in any of the select items, both select items are reduced to only one value!!! The list is no more, the pick list is left with only one value.
We have figured that the select items retain their values if we dont use setAlwaysShowEditors(true); But in our use case we do need to always show the select items.
Can you please tell what are we doing wrong and how to fix it.
Thank you
Browsers Used : IE9 and Chrome
We are using setEditorCustomizer to display a SelectItem in a grid cell using following code snippet.
setCanEdit(true);
setModalEditing(true);
setAutoSaveEdits(true);
setAlwaysShowEditors(true);
setEditEvent(ListGridEditEvent.CLICK);
setEditByCell(true);
this.setEditorCustomizer(new ListGridEditorCustomizer() {
public FormItem getEditor(ListGridEditorContext context) {
ListGridField field = context.getEditField();
PaymentListRecord record = (PaymentListRecord) context.getEditedRecord();
if (field.getName().equals(Fields.MANAGED_SPREAD_FROM_PARENT) ){
SelectItem spreads = new SelectItem();
spreads.setShowTitle(false);
spreads.setWidth("45");
spreads.setHeight("20");
spreads.setValueMap("0", "5", "10", "20", "30" );
return spreads;
}
if (field.getName().equals(Fields.MANAGED_FEE_FROM_PARENT)) {
SelectItem fees = new SelectItem();
fees.setShowTitle(false);
fees.setWidth("45");
fees.setHeight("20");
fees.setValueMap("100", "500", "1000", "2000", "3000" );
return fees;
}
return context.getDefaultProperties();
}
});
The grid displays fine with two select items, one in 'spread' column, the other in 'fees' column. But when user tries to select a value in any of the select items, both select items are reduced to only one value!!! The list is no more, the pick list is left with only one value.
We have figured that the select items retain their values if we dont use setAlwaysShowEditors(true); But in our use case we do need to always show the select items.
Can you please tell what are we doing wrong and how to fix it.
Thank you