SAP UI5/FioriElements: this.getview is not a function

82 views Asked by At

Although many questions exist on the same topic, I could not resolve​ this using the given solutions.

Code

[Snippet from the manifest.json to trigger the same]((https://i.stack.imgur.com/Sb7g6.png)

File structure

Error

How can I resolve this issue?

Many Thanks

1

There are 1 answers

1
Greg Malewski On

Your this is placed in the wrong context or there is no object available while you should have an object for the controller.

Most probably you can reach Source through oEvent (oEvent.getSource()), which will point out to the controller and then you could call getView():

oEvent.getSource().getView()