on 07-28-2022 3:01 PM
I'm using Fiori Elements Templates for OData v4 where I can easily add custom combobox filters for my table using the following example:
https://ui5.sap.com/#/topic/5fb9f57fcf12401bbe39a635e9a32a4e
Now I want to use not a normal `ComboBox` but a `MultiComboBox`, so the `selectedKey` in the example can be changed to `selectedKeys` quite easily. Like so:
<MultiComboBox items="{/Quarters}" selectedKeys="{path: 'filterValues>', type: 'sap.fe.macros.filter.type.Value', formatOptions: { operator: 'com.xxx.ext.controller.CustomFilter.quarterViewFilter' }}">
<core:Item key="{ID}" text="{ID}" />
</MultiComboBox>
It kinda works in the background, but if I select multiple the value becomes a string separated by commas: "value1,value2", so the `MultiComboBox` doesn't show anything then (as it is an invalid item key).
Also it seems I cannot use `setFilterValues` as shown in the example, with the MultiComboBox's `selectionFinish="handler.setQuartersFilter"` event, as I want to use a more complex `sap.ui.model.Filter` filter .
Does anyone have a solution for this?
"sap.fe.macros.filter.type.Value" is only for single value. Since MultiComboBox supports multi values, you cannot use that. Instead, try "sap.fe.macros.filter.type.MultiValue".
<MultiComboBox width="100%" selectedKeys="{path: 'filterValues>', type: 'sap.fe.macros.filter.type.MultiValue'}">
<layoutData>
<FlexItemData growFactor="1" />
</layoutData>
<items>
<core:Item key="1" text="1" />
<core:Item key="2" text="2" />
<core:Item key="3" text="3" />
<core:Item key="4" text="4" />
<core:Item key="5" text="5" />
</items>
</MultiComboBox>
Another type supported here is "sap.fe.macros.filter.type.Range". See the examples at https://ui5.sap.com/test-resources/sap/fe/core/fpmExplorer/index.html#/buildingBlocks/filterBar/filt....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
72 | |
9 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.