Skip to Content
avatar image
Former Member

Problem getting past parameters with routing

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();
        alert(JSON.stringify(parameters));
}

Getting

{
"name":"detailBooking",
"arguments":{},
"config":
       {
         "routerClass":"sap.m.routing.Router",
         "viewType":"XML",
         "viewPath":"adois.ui.view",
         "controlId":"appMain",
         "controlAggregation":"pages",
         "transition":"slide",
         "bypassed":{"target":"notFound"},
         "_async":false,
         "targetParent":"__xmlview0",
         "pattern":"DetailBooking",
         "name":"detailBooking",
         "target":"DetailBooking"
       }
}

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){
        this.getRouter().navTo("detailBooking",{
              data : oEvent.getSource().getBindingContext().getObject()
        });
}

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    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": [
    						"object",
    						"master"
    					]
    				},
    				{
    					"pattern": "detailBooking/{data}",
    					"name": "detailBooking",
    					"target": [
    						"master",
    						"object"
    					]
    				}
    			],
    
    Add comment
    10|10000 characters needed characters exceeded

  • 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.

    Add comment
    10|10000 characters needed characters exceeded