Example: How to Define your own Actions in the Footer BarYou can use this controller hook to define your own actions in the footer bar. The following example shows how to implement it.
In the Component.js
file, in the customizing
section, define a controllerExtension
.
Example
"sap.ui.controllerExtensions" : {
"fin.ar.lineitems.display.view.S1" : {
controllerName: "Extend.MyField.view.ExtS1"
}
},
In the view
folder, create the ExtS1.controller.js
file. You use this file to program the hook implementation. The following implementation example only contains a message toast displaying the text “Hello World”.
Example
sap.ui.controller("Extend.MyField1.view.ExtS1", {
// hook implementation
extHookModifyFooterOptions : function(oOptions) {
var customButton = {
sI18nBtnTxt : "Hello World",
sId : "Extend.MyField.CustomButton",
bDisabled : false,
onBtnPressed : jQuery.proxy(this.onButtonPressedCustomButton,
this),
calcEnabled : function(oController) {
return oController.aSelectedKeys.length >= 1;
}
};
oOptions.buttonList.push(customButton);
return oOptions;
onButtonPressedCustomButton: function(oController, bUnblock, sAction) {
return sap.m.MessageToast.show("Hello world");
},
});