on 12-04-2018 6:39 AM
Hi,
I am facing issue in adding default value to smartfilterbar controlType dropdown.
I have added this in onAfterRendering of page ,but i am getting getItems as empty.
onAfterRendering: function(event) {
var defaultPm=this.getView().byId("filterPM").getItems()[0].getKey();
this.getView().byId("filterPM").addDefaultFilterValue(new sap.ui.comp.smartfilterbar.SelectOption().setLow(defaultPm));
}
<smartFilterBar:SmartFilterBar id="smartFilterBar" entitySet="Entityset" persistencyKey="SmartFilterPKey" showClearOnFB="true"
showRestoreOnFB="true" showFilterConfiguration="false" initialise="onFInitialise" search="onFilter" reset="onReset" >
<smartFilterBar:controlConfiguration id="cf" >
<smartFilterBar:ControlConfiguration key="Pm" visibleInAdvancedArea="true" id="filterPM" mandatory="mandatory" controlType="dropDownList"hasTypeAhead="true">
<!--<smartFilterBar:defaultFilterValues>
<smartFilterBar:SelectOption low="1001"></smartFilterBar:SelectOption>
</smartFilterBar:defaultFilterValues>-->
</smartFilterBar:ControlConfiguration>
</smartFilterBar:controlConfiguration>
<smartFilterBar:layoutData>
<FlexItemData shrinkFactor="0"/>
</smartFilterBar:layoutData>
</smartFilterBar:SmartFilterBar>
Hi Mounika
I believe you have used Fiori elements to generate it via CDS if yes then you can use annotation insertDefaultFilterValue to set default values. Secondly the control has defaultFilterValues as aggregation which you can use to set the default values.
Thanks
Nabheet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
74 | |
10 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.