Hi all,
I am displaying a ListGrid, I have 3 piece of data that I'm displaying, "Name", "Data Type" and "Mapped Field".
In this ListGrid the Mapped Field attribute is editable. The editor type is a select item that will retrieve some fields that can be mapped.
I only want certain fields to be returned based on the data type. So basicly the selectItem values are dependant on the data type value.
This is my code that doesn't currently work...
The reason this code doesn't work is that overridden getPickListFilterCriteria() method is not getting called. I have used this approach in a DynamicForm and it works fine.
The example in the showcase for a dependant select in a list grid is not data bound, it uses setEditorValueMapFunction which won't work for data bound SelectItem.
So is it possible to achieve a data bound select in a list grid?
Thanks,
Dale
SmartGWT Version : 4.0p
SmartGWT Build Date : Mon Dec 23 10:04:00 GMT 2013
GWT Version : 2.4.0
I am displaying a ListGrid, I have 3 piece of data that I'm displaying, "Name", "Data Type" and "Mapped Field".
In this ListGrid the Mapped Field attribute is editable. The editor type is a select item that will retrieve some fields that can be mapped.
I only want certain fields to be returned based on the data type. So basicly the selectItem values are dependant on the data type value.
This is my code that doesn't currently work...
Code:
inputGrid.setDataSource(new TaskFlowInputsDS()); inputGrid.setAlwaysShowEditors(true); ListGridField name = new ListGridField(TaskFlowInputsDS.NAME); ListGridField type = new ListGridField(TaskFlowInputsDS.DATA_TYPE_DISPLAY); SelectItem fieldsSelect = new SelectItem() { @Override protected Criteria getPickListFilterCriteria() { Integer dataTypeId = 1; //TODO - Get value from TaskFlowInputsDS.DATA_TYPE_ID Criteria criteria = new Criteria(); criteria.addCriteria(TaskFlowFieldDS.DATA_TYPE, dataTypeId); return criteria; } }; fieldsSelect.setOptionDataSource(fieldsDataSource); fieldsSelect.setValueField(TaskFlowFieldDS.ID); fieldsSelect.setDisplayField(TaskFlowFieldDS.NAME); fieldsSelect.setAllowEmptyValue(true); fieldsSelect.setEmptyDisplayValue("No Field Mapped"); fieldsSelect.setAddUnknownValues(false); ListGridField inputField = new ListGridField(TaskFlowInputsDS.INPUT_FIELD_ID, "Mapped Field"); inputField.setEditorProperties(fieldsSelect); inputField.setCanEdit(true); inputGrid.setFields(name, type, inputField);
The example in the showcase for a dependant select in a list grid is not data bound, it uses setEditorValueMapFunction which won't work for data bound SelectItem.
So is it possible to achieve a data bound select in a list grid?
Thanks,
Dale
SmartGWT Version : 4.0p
SmartGWT Build Date : Mon Dec 23 10:04:00 GMT 2013
GWT Version : 2.4.0
Comment