I am new to SAPUI5.
I have two components/folders with views & controllers named 'view' and 'tableview'. Is it possible get 'view' context in 'tableview' ?
I am new to SAPUI5.
I have two components/folders with views & controllers named 'view' and 'tableview'. Is it possible get 'view' context in 'tableview' ?
If I understood correctly you are trying to access a parent controller from a child controller. Here are some proposals ordered from noob to expert ;)
The simplest approach would be to just use a global variable to provide reference to the controller you need - not recommended.
Give your parent view an id and call a method on it's controller like this:
sap.ui.getCore().byId("parentViewId").getController().method();
You can directly call a controllers method like this:
sap.ui.controller("namespace.Controllername").method();
I would highly recommend a more decoupled way of communication between controllers (or application components in general) using the sap.ui.core.EventBus. It implements a pattern known as Event or Message Bus and imho really rocks ;)
GL Chris