on 01-25-2018 7:58 PM
Hi,
I am looking to capture URI parameters using my SAP UI5 application.
I am navigating to this URI
http://someurl.uk.incorg.net:8000/GDMI_N/0RPO/XSAPPS/CORE_KPI/index.html#/em_202_Long_Job_Exceptions...
50546445 = payroll
I want to capture that payroll to then use in a query, how do I do this please?
Any help much appreciated!
Thanks
Hi! If inside your app this hash (/em_202_Long_Job_Exceptions/50546445) defined as route, you can use attachRouteMatched of your Router.
manifest.json
...
"routes": [{
"pattern": "em_202_Long_Job_Exceptions/{payroll}",
"name": "jobExceptions",
"target": "jobExceptions"
}],
"targets": {
"jobExceptions": {
"viewName": "jobExceptions",
"viewLevel" : 1
}
...
jobExceptions.controller.js
onInit: function () {
var oRouter = this.getRouter();
oRouter.getRoute("jobExceptions").attachMatched(this._onRouteMatched, this);
},
_onRouteMatched : function (oEvent) {
var oArgs, oView;
oArgs = oEvent.getParameter("arguments");
var sPayroll = oArgs.payroll;
//use your payroll;
}
Or you can use rough way (not recommended):
var sPayroll = window.hasher.getHashAsArray()[1];
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try to get 50546445 from url?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.