Skip to Content

How to refresh odata model on hitting the fiori launchpad back button?

I have two pages, on the second page when I do some odata modification (basically making a POST call to alter the data), I want to make those changes get reflected in the 1st page when I press the back button on the second page of the fiori launchpad.

How do I achieve that?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Oct 11, 2018 at 03:45 PM

    you can attach an event handler to the route match event.

    when you navigate back, you can do the refresh in that event handler.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 15, 2018 at 07:46 AM

    One way to change the button event can be:

    sap.ui.getCore().byId("backBtn").mEventRegistry.press[0].fFunction = function(){
    ............
    };

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 21, 2018 at 10:38 AM

    Hi Debojit,

    Jun Wu suggested route-matched event of Router not button.

    My suggestion is to either put a back button in header of your application and handle refresh in press event or handle refresh in route matched event.

    this.getRouter().getRoute("page1").attachPatternMatched(this._onRouteMatchedPage1, this);
    
    _onRouteMatchedPage1: function(oEvent){
    // handle refresh here
    }

    Hope this helps.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.