Hi,
I'm trying to user a list grid as a filter editor property in the filter editor. Generally the list works fine, but
I'm also trying to display a recordComponent in the grid and the problem is that the ListGrid.createRecordComponent(ListGridRecord record, Integer colNum)
method is not firing although setShowRecordComponent is set to true.
I'm trying to user a list grid as a filter editor property in the filter editor. Generally the list works fine, but
I'm also trying to display a recordComponent in the grid and the problem is that the ListGrid.createRecordComponent(ListGridRecord record, Integer colNum)
method is not firing although setShowRecordComponent is set to true.
Code:
public static ListGridField makeTagsField() {
ListGridField tag = new ListGridField(MessageInterface.TAGS, "Tags", 50);
tag.setFilterEditorProperties(getTagFilterSelectItem());
tag.setFilterOperator(OperatorId.CONTAINS);
tag.setFilterOnKeypress(true);
tag.setCellFormatter(new CellFormatter() {
@Override
public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
return null;
}
});
tag.setShowHover(false);
return tag;
}
private static CaseTagFilterSelectItem getTagFilterSelectItem() {
CaseTagFilterSelectItem tagfilItem = new CaseTagFilterSelectItem();
return tagfilItem;
}
public class CaseTagFilterSelectItem extends SelectItem {
public CaseTagFilterSelectItem() {
setMultiple(true);
setMultipleAppearance(MultipleAppearance.PICKLIST);
setSortField(CaseTagModel.LABLE);
setDisplayField(CaseTagModel.LABLE);
setValueField(CaseTagModel.ID);
setWidth(150);
setPickListWidth(150);
ListGrid propertiesGrid = new ListGrid() {
@Override
protected Canvas createRecordComponent(ListGridRecord record, Integer colNum) {
String fieldName = this.getFieldName(colNum);
return CasesHelper.createVisualCueRecordComponent(record, fieldName);
}
};
propertiesGrid.setShowRecordComponents(true);
propertiesGrid.setShowRecordComponentsByCell(true);
propertiesGrid.setShowHeader(true);
propertiesGrid.setShowFilterEditor(true);
propertiesGrid.setFilterOnKeypress(true);
ListGridField nameListGridField = new ListGridField(CaseTagModel.LABLE, "Lable");
ListGridField tagListGridField = new ListGridField(CaseTagModel.VISUAL_CUE, "Cue", 30);
propertiesGrid.setFields(tagListGridField, nameListGridField);
setPickListFields(tagListGridField, nameListGridField);
setPickListProperties(propertiesGrid);
setOptionDataSource(AppUtils.get().getLoadedCaseTags().unwrap());
}
}