Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10313

Re: Custom Router Class Registeration

$
0
0

Hello Vikram,

 

Not sure if you still have the problem.

 

As a temporary workaround, I copied over the code for missing methods from MyRouter.js to Component.js and declared the missing methods as properties of Router's prototype. I added the code just before the router is initialized. You can see the code I used down below.

 

This will get rid of our immediate problem. However, a little further along in the example, when 'Save' is clicked, there is another error in _getChangeUrl of ODataModel.prototype where getPath() on 'c' is undefined.

 

May be this example is not meant for us to follow along.

 

Cheers,

-Michelle

 

  sap.ui.core.routing.Router.prototype.myNavBack = function(sRoute, mData) {  var oHistory = sap.ui.core.routing.History.getInstance();  var sPreviousHash = oHistory.getPreviousHash();  // The history contains a previous entry  if (sPreviousHash !== undefined) {  window.history.go(-1);  } else {  var bReplace = true; // otherwise we go backwards with a forward history  this.navTo(sRoute, mData, bReplace);  }
 };  sap.ui.core.routing.Router.prototype.myNavToWithoutHash = function (oOptions) {  var oSplitApp = this._findSplitApp(oOptions.currentView);  // Load view, add it to the page aggregation, and navigate to it  var oView = this.getView(oOptions.targetViewName, oOptions.targetViewType);  oSplitApp.addPage(oView, oOptions.isMaster);  oSplitApp.to(oView.getId(), oOptions.transition || "show", oOptions.data);  };  sap.ui.core.routing.Router.prototype.backWithoutHash = function (oCurrentView, bIsMaster) {  var sBackMethod = bIsMaster ? "backMaster" : "backDetail";  this._findSplitApp(oCurrentView)[sBackMethod]();  };  sap.ui.core.routing.Router.prototype.destroy = function() {  sap.ui.core.routing.Router.prototype.destroy.apply(this, arguments);  this._oRouteMatchedHandler.destroy();  };

Viewing all articles
Browse latest Browse all 10313

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>