on 05-13-2020 12:42 PM
Hello,
I'm developing a Fiori Analytical List Page (ALP) app using Custom filters.
I need the Comboxes by default to select the fist value of the list (based on the aggregation binding), instead of having it empty.
<smartfilterbar:ControlConfiguration key="zdivision" index="1" label="{FilterDivision}" groupId="_BASIC">
<smartfilterbar:customControl >
<ComboBox id="idDivision" change="onChangeDivision" items="{ path: '/Z_I_DIVISION' }">
<items>
<core:Item text="{Description}" key="{Division}"/>
</items>
</ComboBox></smartfilterbar:customControl></smartfilterbar:ControlConfiguration>
I've tried with the GetFirstItem function but it's not working in the launchapd.
onInitSmartFilterBarExtension: function (oEvent) {
var oCBDivision = this.byId("idDivision");
var oFirstItemDiv = oCBDivision.getFirstItem();
oCBDivision.setSelectedItem(oFirstItemDiv);
...
Runing from the WebIDE GetFirstItem works when I open the app but afterwards when I change a first combobox to filter a second one, the GetFirstItem doesn't work (I use this to set the first item of the second combobox as the default one).
It gets the first item before the filter was executed.
oPeriod.getBinding("items").filter(oFilter, sap.ui.model.FilterType.Application);
var oFirstItemPeriod = oPeriod.getFirstItem(); oPeriod.setSelectedItem(oFirstItemPeriod);
Thanks
Thanks I have formatted it to show he code in the right way. I hope it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
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.