/scripts/ahub.form.attachments.js
0

Error: Cannot read property '_display' of undefined

May 19, 2017 at 12:37 PM

427

avatar image
Former Member

Hi,

I am getting the below error "Uncaught TypeError: Cannot read property '_display' of undefined" when I try to executes the SAPUI5 application through routing. Please find the screen shot of the error:

When I debug the application I get the error at line:

Could you please help me resolve the issue. Please find the Component.js code below:

capture.jpg (33.9 kB)
capture.jpg (45.9 kB)
capture.jpg (36.7 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Jun Wu May 19, 2017 at 03:10 PM
0

check if it helps

oRouter.getTargets().display

Show 5 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Jun,

This does not work for me. It says "getTargets().display" is undefined.

Regards,

Rachit.

0

how you get oRouter?

0
Former Member

var oRouter = this.getRouter();

Is this not correct?

0

Hi Rachit ,

var oRouter = this.getRouter();

getRouter is not a predefined function you need to define this function in your controller or in the base controller which you can access in any controller inherited from base controller :

getRouter : function () { return sap.ui.core.UIComponent.getRouterFor(this); },

thanks

Viplove

0
Former Member

Thanks Viplove.

How I get this error:

Uncaught TypeError: Cannot read property 'initialize' of undefined

0
Mahesh kumar palavalli May 23, 2017 at 07:23 AM
0

In the Routes, you have mentioned the route name as "Master.view.js".. you just need to mention "Master" and and you need to add a new property "viewType" : "JS".

Best Regards,
Mahesh

Show 5 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thanks Mahesh for your reply.

I made the changes mentioned by you. Still facing the same issue.

0

same error or its a different one this time?

0
Former Member

Same issue :(

0

I am pretty sure there is some issue with your routes & targets.. can you copy paste your routing section once.

Best Regards,

Mahesh

0
Former Member
Mahesh kumar palavalli

Hi Mahesh,

Here is my routing section:

metadata: {

"rootView": "sapui5.demo.mvcapp.MVC1.webapp.view.App",

"config": { "serviceUrl": "service/data.json" },

"routing": {

"config": {

"routerClass": "sap.m.routing.Router",

"viewType": "XML",

"viewPath": "sapui5.demo.mvcapp.MVC1.webapp.view",

"controlId": "app",

"controlAggregation": "pages", "transition": "slide" },

"route": [{ "pattern": "", "name": "master", "target": "master", "greedy": false }],

"target": {

"master": {

"viewName": "Master",

"viewPath": "sapui5.demo.mvcapp.MVC1.webapp.view",

"viewType": "XML",

"viewLevel": 1,

"transition": "slide",

"clearAggregation": "true"

}

}

}

},

0
Skip to Content