I have a master view which I have added a filter button to via the settings area. I have created a fragment that will contain a dialog for a filter.
The fragment is in XML as follows:
<core:FragmentDefinition xmlns:core="sap.ui.core" xmlns="sap.m"> <ViewSettingsDialog id="dialogFilter" cancel="handleCancel" confirm="handleConfirm" resetFilters="handleResetFilters"> <filterItems id="filterItemsId"> <ViewSettingsCustomItem id="idCustomFilterItem" key="myFilter" text="Employee Name"> <customControl> <VBox> <List id="filterlist" items="{path: '/ZHR_S_ATTR_Set'}" mode="{device>/listMode}" noDataText="{i18n>masterListNoDataText}" select="onSelect"> <items id="EENameList"> <CustomListItem> <Text text="{EMP_Name}"/> </CustomListItem> </items> </List> </VBox> </customControl> </ViewSettingsCustomItem> </filterItems> </ViewSettingsDialog></core:FragmentDefinition>Essentially, I want a filter category of Employee Name and the values of Employee Name I would like to retrieve from the entity set /ZHR_S_ATTR_SET and the field EMP_Name.
The dialog itself is working, when I click on the filter button I get the following:
But when I click on Employee Name, I don't have any values:
I have tried various ways through XML and have also attempted to add items to the filter category through the master controller, but no luck.
Looking for some guidance, should I not be using a list here?
Is there a way to achieve this purely through XML?
If it has to be done through JavaScript in the controller, how can I achieve it?
I've tried something like the this:
| var oViewSettingsDialog = sap.ui.getCore().byId("dialogFilter"); | |||
| var p = this._createFilterCategory("Employee Name", true); | |||
| var V = "EMP_Name" + ":" + "Gary D Flegel"; | |||
| var v = this._createFilterItem(V, "Emp Name"); | |||
| p.addItem(v); |
But then I haven't been able to find a way to bind this to my control.

