Skip to Content

Problem getting past parameters with routing

Mar 21, 2017 at 07:46 PM


avatar image

Hi, i hope can you help me,

I am trying to get past parameters with routing, but when using,

in the onInit method, getting router and attach method "onRoutePatternMatched"

 onRoutePatternMatched: function(oEvent){                
        var parameters = oEvent.getParameters();



As you can see, you are not getting anything in arguments.

from view send data to router "detailBooking"

I am using this method to send the data to the route,

onNavDetailBooking: function(oEvent){
              data : oEvent.getSource().getBindingContext().getObject()

I hope you can give me some suggestions, thanks in advance.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Seungchul Yang Mar 22, 2017 at 01:21 AM

Please paste routing configruation code of your manifest.json.

A pattern of 'detailBooking' should include a argument.

	"routes": [
					"pattern": "",
					"name": "master",
					"target": [
					"pattern": "detailBooking/{data}",
					"name": "detailBooking",
					"target": [
Show 2 Share
10 |10000 characters needed characters left characters exceeded

I do not want to change the pattern of my url, I simply want to pass data to the other view, is it possible without having to change the pattern?


There is no way to pass a data to another view with routing without modifying a pattern, I think.

Check below link

Jun Wu Mar 22, 2017 at 04:15 AM

for onRoutePatternMatched, is it triggered by onNavDetailBooking?

if it is not triggered by that, you probably will have nothing.

Show 4 Share
10 |10000 characters needed characters left characters exceeded

What do you mean by

"is it triggered by onNavDetailBooking"

Could you give me an example code please?

        this.getRouter().navTo("detailBooking",{data: oEvent.getSource().getBindingContext().getObject()});}

this will trigger the navigation, and onRoutePatternMatched this will be called.
in this case, you will have the data(I assume:))

onRoutePatternMatched may also be invoked in initial page load. in that case, you may have no data.

The navigation if it activates, I am able to navigate to the route, but it does not obtain any data


show me the route?