Hi,
I am trying to use a comboboxitem as the editortype for a ListGridField. Below is the code that sets up the comboboxitem editortype for the ListGridField:
I have 2 questions regarding using this usage scenario.
1) When the ComboboxItem.ChangedHandler gets fired, how do I get a reference to the actula ComboboxItem instance that fired he event, so I that can get the SelectedRecord if any off of it. I tried doing event.getItem(), but that only returned a FormItem, not a ComboboxItem. the event.getForm(), and event.getSource() did not help either.
2) It seems that whenever I set the DisplayField as follows:
it screws up the criteria setting on the OptionDataSource. More specifically, every time I go into edit mode in the ListGridField, I see requests in the developer console where the criteria is set the FP_ID = "FULL_NAME" value. I don't know why setting the DisplayField value has anything to do with the Criteria setting, which I thought should always be set according to this line of code:
I am using SmartGWT 2.5 latest nightly build, and IE8 on Windows 7.
Thanks in advance,
Mike
I am trying to use a comboboxitem as the editortype for a ListGridField. Below is the code that sets up the comboboxitem editortype for the ListGridField:
Code:
clients = new ComboBoxItem("clientCombo");
DataSourceField pk = clientsDS.getField("ID");
pk.setPrimaryKey(true);
clients.setOptionDataSource(clientsDS);
clients.setPickListCriteria(new Criteria("ROLE", "INVESTOR"));
clients.setValueField("FP_ID");
clients.setDisplayField("FULL_NAME");
clients.setFilterFields("FULL_NAME");
clients.setCompleteOnTab(true);
pickListProperties.setAutoFetchData(false);
pickListProperties.setShowHeader(false);
clients.setPickListProperties(pickListProperties);
ListGridField fullName = new ListGridField("FULL_NAME");
clients.setPickListWidth(280);
clients.addChangedHandler(new ChangedHandler() {
public void onChanged(ChangedEvent event) {
FormItem item = event.getItem();
DynamicForm form = event.getForm();
SC.logWarn("valuefield value: " + item.getValue());
}
});
setEditByCell(true);
setEditEvent(ListGridEditEvent.CLICK);
setAutoSaveEdits(false);
setConfirmCancelEditing(true);
ListGridField clientName = getField("USER.FULL_NAME");
clientName.setCanEdit(true);
clientName.setEditorType(clients);
clientName.setFilterEditorType(new TextItem());
1) When the ComboboxItem.ChangedHandler gets fired, how do I get a reference to the actula ComboboxItem instance that fired he event, so I that can get the SelectedRecord if any off of it. I tried doing event.getItem(), but that only returned a FormItem, not a ComboboxItem. the event.getForm(), and event.getSource() did not help either.
2) It seems that whenever I set the DisplayField as follows:
Code:
clients.setDisplayField("FULL_NAME");
Code:
clients.setPickListCriteria(new Criteria("ROLE", "INVESTOR"));
Thanks in advance,
Mike
Comment