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

Re: Get the previous page id when navigating to new view

$
0
0

Hey,

 

For this purpose i generally send a key parameter from previous page and keep it as a global variable on next view.

 

This is the navigation code from 1st page, sending guid as a parameter

 

// read guid

  var oModel = this.getView().getModel();

  var sGuid = oModel.getProperty(this._sOrderPath+"/Guid");

// navigate

  if (sGuid){

    sap.ui.core.UIComponent.getRouterFor(this).navTo("edit",{

      Guid : sGuid,

    }, true);

  }

 

 

On 2nd page you can get this parameter and simply keep it global to use it when needed.

 

on your pattern matched / route matched event:

 

  var oParameters = oEvent.getParameters();

  this._sGuid = oParameters.arguments.Guid;

 

 

 

Just like that you can send whatever you want in between views.

 

 

Regards

 

Ugur


Viewing all articles
Browse latest Browse all 3193

Trending Articles



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