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

Custom Router Class Registeration

$
0
0

Hi,

 

I am trying to create sample application by following below guide:

 

https://sapui5.netweaver.ondemand.com/sdk/#docs/guide/688f36bd758e4ce2b4e682eef4dc794e.html

 

Here they have developed custom class for router and its configured in component metadata.

 

routing : {

config : {

routerClass : sap.ui.demo.tdg.MyRouter,

viewType : "XML",

viewPath : "sap.ui.demo.tdg.view",

targetAggregation : "detailPages",

clearTarget : false

},

 

In Master view, on click of AddProduct button, they taking the reference of router and calling custom router class method

 

https://sapui5.netweaver.ondemand.com/sdk/#docs/guide/a425399ec2fe47a8b9ba9653ab4f6623.html

 

 

onAddProduct : function() {

sap.ui.core.UIComponent.getRouterFor(this).myNavToWithoutHash({

currentView : this.getView(),

targetViewName : "sap.ui.demo.tdg.view.AddProduct",

targetViewType : "XML",

transition : "slide"

});

}

 

But here I am getting "myNavToWithoutHash is not a function" error. It is still refering to standard Router class instead of MyRouter custom class.

 

Are there any more steps to register our custom router class? I have followed the steps mentioned in tutorial but its not working.

 

Is routerClass valid metadata configuration parameter for Component? Because I could not find it in component metadata tutorial (  https://sapui5.netweaver.ondemand.com/sdk/#docs/guide/0187ea5e2eff4166b0453b9dcc8fc64f.html  )

 

 

Regards,

Vikram


Viewing all articles
Browse latest Browse all 9159

Trending Articles



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