-2

I am trying to modify the master view (S2.view.xml) of the Fiori Purchase Req Approval App. I need to add a footer to this view. I tried adding footer to the S2 view XML but it didnt work. So looked like the S2 controller, getHeaderFooter() needs modification. My questions

1) Is this a standard method? Why is it added to the controller

2) If I have to add footer, how do I add it to the Master view???

3) How do I suppress the method in case required?

Appreciate your help.

Thank you

1

1 Answer 1

0

1) Is this a standard method? Why is it added to the controller

You are supposed to override getHeaderFooterOptions in your controller.

2) If I have to add footer, how do I add it to the Master view???

The following code sample is to add two Buttons Test1 and Test2 to footer.

getHeaderFooterOptions : function() {
    var oOptions = {
        buttonList: [{
        sI18nBtnTxt: "Test1",
        onBtnPressed: function() {

        }
        }, {
        sI18nBtnTxt: "Test2",
        onBtnPressed: function(oEvent) {

        }
        }]
    };
    return oOptions;
},

For details about overriding getHeaderFooterOptions, see the documentation.

3) How do I suppress the method in case required?

You can't suppress the method.

8
  • Thanks Allen - I tried this but it adds the button to the far right corner of the view. "test1" button is on the footer, but "test2" iopens up if you click. I need to put the other button directly on the footer?? Is that possible?? Sep 10, 2014 at 18:44
  • I don't really understand what you want to achieve. "The far right corner of the view" is part of the footer. what do you mean "test2" opens up if you click?
    – Haojie
    Sep 10, 2014 at 23:42
  • Hi allen, I wish I could add image here..So, I basically want to add few buttons on the Footer which should be displayed directly on the footer, and should not need any additional click to display the pop -up of buttons. I tried what you suggested, the test 1 displays correctly, but then a option is displayed like '...'. If you click on this option, then only'test 2' displayed as a pop-up. Sep 11, 2014 at 14:24
  • This is because of the overflow behavior, the buttons are by default added to content-right of the footerbar, there is no way you can change it.
    – Haojie
    Sep 12, 2014 at 7:26
  • Thanks Allen, it makes sense now. How about the oPositiveAction & oNegativeAction buttons? Even they will also be added to content-right?? Sep 12, 2014 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.