cancel
Showing results for 
Search instead for 
Did you mean: 

Open SAPUI5 application via clicking a URL/link

arindam_samanta
Participant
0 Kudos

Hello Experts,

I have opened one web portal. In that portal I have one link. If I click the link, I would like to open my SAPUI5 application with one parameter. The parameter, I would like pass from the link available in my Portal and send to my new SAPUI5 application.

Also I would like to receive that parameter value in my SAPUI5 application and do some operation with that parameter.

So my question is, How I can pass one parameter from one portal to SAPUI5 application when it is called via link and How can I get the value inside my application?

Could you please help me on this area?

Thanks in advanced!

Thanks,
Arindam.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member467961
Participant

Hello,

you can just use an optional parameter, while defining the route to your new UI5 application in manifest file:

//optional param is defined between two colons (:) as follows
"routes": [{
"pattern": "path/tp/application/:optionaPramam:",
"name": "starterPage",
"target": "starterPage"
}
…]

"targets": {
...
}
then in the controller of the main view, you can access the optional parameter as follows:
onInit: function () {
	var oRouter = this.getRouter();
	oRouter.getRoute("starterPage").attachMatched(this._onRouteMatched, this);
},

_onRouteMatched : function (oEvent) {
	var oArgs;
	oArgs = oEvent.getParameter("arguments");
	//now obtain the value from optional parameter passed
	var val = oArgs.optionaPramam
	//use the val as needed
}