How execute code every time that I view a page

后端 未结 3 1202
难免孤独
难免孤独 2020-11-29 11:19

I\'m searching the mode to execute a code (in my case the retrieve of data to visualize from server) every time I view a page (every time the page is called by splitAp

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-29 11:44

    If routing is used, another version of Allen's code:

     onInit : function () {
       this._oRouter = sap.ui.core.UIComponent.getRouterFor(this);
       this._oRouter.getRoute("detail").attachMatched(this.handleRouteMatched, this);
    },
    
      handleRouteMatched : function (evt) {
        //You code here to run every time when your detail page is called.
      }
    

提交回复
热议问题