javascript - SAPUI5 event handler function for view leave -


i declared controller view in sapui5 application. want perform tasks when view leaved user.

there possibility add callback function attachroutepatternmatchedto perform tasks when view navigated user need equivalent function handle leave of view. use splitcontainer parent container

oninit: function () {     this._orouter = sap.ui.core.uicomponent.getrouterfor(this);     this._orouter.attachroutepatternmatched(this._routepatternmatched, this); },   _routepatternmatched: function (oevent) {     var = this;     var sroutetargetname = oevent.getparameter("name");     if (sroutetargetname === "myview") {          // perform tasks if view opened user      }  }, 

you can try if works:

navaway: function(viewname, callback) {     this._orouter.navto(viewname);     if(callback && typeof(callback) === "function") {         callback();     } } 

e.g. this.navaway("myview", function() { //dostuff });


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -