Skip to Content
0
Sep 23, 2016 at 11:34 AM

Filter Bar aggregation binding not working

733 Views

Hi,

I am using sap.ui.comp.filterbar.FilterBar control . I am trying bind aggragtions "filterItems" as below.

<fb:FilterBar reset="onReset" search="onSearch" showRestoreButton="true" showClearButton="true" filterBarExpanded="false"

filterItems="{/Filters}">

<fb:filterItems>

<fb:FilterItem name="{Name}" label="{Label}">

<fb:control>

<Input valueHelpRequest="handleValueHelp" showValueHelp="true" valueHelpOnly="true"/>

</fb:control>

</fb:FilterItem>

</fb:filterItems>

</fb:FilterBar>


and my data looks like:

{

"Filters":[

{"Name":"A", "Label":"LabelA"},

{"Name":"B", "Label":"LabelA"},

{"Name":"C", "Label":"LabelA"},

{"Name":"D", "Label":"LabelA"}

]

}

It throws an error in library "filterBar.js",

FilterBar.js:6 Uncaught (in promise) Error: sap.ui.comp.filterbar.FilterBar.prototype.addFilterItem() Expected argument 'oFilterItem.name' may not be null nor empty(…)


I have checked the binding context of filter item in addFilterItem method in filterBar.js, I can see teh proper binding context there.

I tried to bind in script, but no luck.

Is there an issue with aggregation binding of Filter Bar?

Thanks in advance.