Example: How to Define your own Actions in the Footer Bar

Implement the exHookModifyFooterOptions controller hook

You can use this controller hook to define your own actions in the footer bar. The following example shows how to implement it.

  1. In the Component.js file, in the customizing section, define a controllerExtension.

    Example Example

    "sap.ui.controllerExtensions" : {

    "fin.ar.lineitems.display.view.S1" : {

    controllerName: "Extend.MyField.view.ExtS1"

    }

    },

    End of the example.
  2. 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 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");

    },

    });

    End of the example.