
"extends": {
"extensions": {
"sap.ui.controllerExtensions": {
"sap.suite.ui.generic.template.AnalyticalListPage.view.AnalyticalListPage": {
"controllerName": "demo.alp.ALPDemo.ext.controller.AnalyticalListPageExt",
"sap.ui.generic.app": {
"SEPMRA_C_PD_ProductSalesData": {
"EntitySet": "SEPMRA_C_PD_ProductSalesData",
"Actions": {
"ActionSEPMRA_C_PD_ProductSalesData1": {
"id": "ActionSEPMRA_C_PD_ProductSalesData1button",
"text": "{{ActionSEPMRA_C_PD_ProductSalesData1}}",
"press": "onClickActionSEPMRA_C_PD_ProductSalesData1"
},
"ActionSEPMRA_C_PD_ProductSalesData2": {
"id": "ActionSEPMRA_C_PD_ProductSalesData2button",
"text": "{{ActionSEPMRA_C_PD_ProductSalesData2}}",
"press": "onClickActionSEPMRA_C_PD_ProductSalesData2"
},
"ActionSEPMRA_C_PD_ProductSalesData3": {
"id": "ActionSEPMRA_C_PD_ProductSalesData3button",
"text": "{{ActionSEPMRA_C_PD_ProductSalesData3}}",
"press": "onClickActionSEPMRA_C_PD_ProductSalesData3",
"filter": "chart"
}
}
}
}
}
},
onClickActionSEPMRA_C_PD_ProductSalesData1: function (oEvent) {
alert("SEPMRA_C_PD_ProductSalesData1 is clicked");
},
onClickActionSEPMRA_C_PD_ProductSalesData2: function (oEvent) {
alert("SEPMRA_C_PD_ProductSalesData2 is clicked");
},
onClickActionSEPMRA_C_PD_ProductSalesData3: function (oEvent) {
alert("SEPMRA_C_PD_ProductSalesData3 is clicked");
},
"sap.ui.viewExtensions": {
"sap.suite.ui.generic.template.AnalyticalListPage.view.AnalyticalListPage": {
"SmartFilterBarControlConfigurationExtension|SEPMRA_C_PD_ProductSalesData": {
"className": "sap.ui.core.Fragment",
"fragmentName": "demo.alp.ALPDemo.ext.fragment.Customfilter",
"type": "XML"
}
}
<core:FragmentDefinition xmlns="sap.m" xmlns:smartfilterbar="sap.ui.comp.smartfilterbar" xmlns:core="sap.ui.core">
<smartfilterbar:ControlConfiguration key="pricerange" index="1" label="Custom Filter" groupId="_BASIC">
<smartfilterbar:customControl>
<ComboBox id="id">
<core:Item key="0" text="Item1"/>
<core:Item key="1" text="Item2"/>
<core:Item key="2" text="Item3"/>
</ComboBox>
</smartfilterbar:customControl>
</smartfilterbar:ControlConfiguration>
</core:FragmentDefinition>
onInitSmartFilterBarExtension: function(oEvent) {
var oSmartFilterBar = oEvent.getSource();
oSmartFilterBar.getControlByKey("pricerange").attachSelectionChange(function(oChangeEvent){
alert(oChangeEvent.getParameter("selectedItem").getText() + " selected");
},this);
},
/*
* Content of the custom field shall be stored in the app state, so that it can be restored later again e.g. after a back navigation.
* @param oCustomData : referance to the custome data.
*/
getCustomAppStateDataExtension: function (oCustomAppData) {
var oCustomField1 = this.oView.byId("customFilterComboBox");
if (oCustomField1) {
oCustomAppData.SampleFilterFieldID = oCustomField1.getValue();
}
return oCustomAppData;
},
/*
* In order to restore content of the custom field in the filterbar e.g. after a back navigation.
* @param oCustomData : referance to the custome data.
*/
restoreCustomAppStateDataExtension: function (oCustomAppData) {
if (oCustomAppData.SampleFilterFieldID !== undefined) {
if ( this.oView.byId("customFilterComboBox") ) {
this.oView.byId("SampleFilterFieldID").setSelectedKey(oCustomAppData.SampleFilterFieldID);
}
}
}
onBeforeRebindChartExtension: function (oEvent) {
alert("onBeforeRebindChartExtension called!");
},
onBeforeRebindTableExtension: function (oEvent) {
alert("onBeforeRebindTableExtension called!");
}
onBeforeRebindFilterableKPIExtension should be used to sync your ALP's filterable KPI tag value to your custom filter values.
onBeforeRebindFilterableKPIExtension: function (oSelectionVariant, sEntityType, sKPIId) {
if (sKPIId ===
"demo.alp.ALPDemo::sap.suite.ui.generic.template.AnalyticalListPage.view.AnalyticalListPage::SEPMRA_C_PD_ProductSalesData--template::KPITag::kpi::KPIRevenue1"
) {
oSelectionVariant.addSelectOption("Item", "I", "EQ", "item 1", null);
}
}
onClearFilterExtension: function (oEvent) {
if (this.byId("customFilterComboBox")) {
this.byId("customFilterComboBox").setSelectedKey(null);
}
}
onBeforeRebindVisualFilterExtension extension method can be used to change the properties of your visual filters. But one another very commonly used and important use case of this extension method is to provide a batch id to your visual filters so that the data fetch call for the visual filters having same batch id should be combined within the same batch call. By default, data fetch call for all visual filters goes as one BATCH call. This functionality is very much to performance optimization of your ALP application.
onBeforeRebindVisualFilterExtension: function (sEntityType, sDimension, sMeasure, oContext) {
switch (sDimension) {
case "Product":
oContext.groupId = "Group1";
break;
case "Currency":
oContext.groupId = "Group3";
break;
case "Product1":
oContext.groupId = "Group2";
break;
default:
oContext.groupId = "default";
}
},
"ResponsiveTableColumnsExtension|SEPMRA_C_PD_ProductSalesData": {
"type": "XML",
"className": "sap.ui.core.Fragment",
"fragmentName": "demo.alp.ALPDemo.ext.fragment.customtable"
}
<core:FragmentDefinition xmlns:core="sap.ui.core" xmlns="sap.m">
<Column id="ExtensionWizard::ColumnBreakout">
<Text text="Sample column"/>
<customData>
<core:CustomData key="p13nData" value='\{"columnKey": "Test", "columnIndex" : "101"}'/>
</customData>
</Column>
</core:FragmentDefinition>
onListNavigationExtension: function(oEvent) {
var oNavigationController = this.extensionAPI.getNavigationController();
var oBindingContext = oEvent.getSource().getBindingContext();
var oObject = oBindingContext.getObject();
// for notebooks we trigger external navigation for all others we use internal navigation
if (oObject.CostCenter == "300-1000") {
oNavigationController.navigateExternal("ActualCostsKPIDetails");
} else {
// return false to trigger the default internal navigation
return false;
}
// return true is necessary to prevent further default navigation
return true;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
18 | |
12 | |
11 | |
10 | |
9 | |
8 | |
7 | |
7 | |
6 | |
5 |