Hi Experts
I am getting error cannot read property 'initialize' of undefined please help me
Component.js
//Declare the component
jQuery.sap.declare("gensoft.ui.product.Component");
//Create the component
sap.ui.core.UIComponent.extend("gensoft.ui.product.Component",
{
metadata:
{
Manifest : "json"
},
/* init:function()
{
//Initialize the Router
sap.ui.core.UIComponent.prototype.init.apply(this);
var oRouter = this.getRouter();
oRouter.initialize();
}*/
init:function()
{
//initialize the router
sap.ui.core.UIComponent.prototype.init.apply(this, arguments);
this.getRouter().initialize();
}
});
Manifest.js:
{
"sap.app":
{
"id":"gensoft.product"
},
"sap.ui5":
{
"rootView":"view.App",
"routing":
{
"config":
{
"routerClass":"sap.m.routing.Router",
"viewType" : "XML",
"viewPath" : "view",
"controlId" : "App",
"controlAggregation" : "pages"
},
"routes":[
{
"pattern" :"",
"name" :"productL",
"viewName" :"ProductList"
},
{
"pattern" :"productDtl",
"name" :"productdtls",
"viewName" : "ProductDetails",
"target" : "prodDTL"
}
],
"targets":
{
"prodDTL":
{
"viewName" : "ProductDetails",
"viewLevel" : 2
}
}
}
}
}