on 03-28-2016 8:47 AM
Dear Guys,
I create a master view in which i put such code:
<mvc:View xmlns:mvc="sap.ui.core.mvc"
xmlns:custom="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1"
xmlns="sap.m">
<App id="myApp">
</App>
</mvc:View>
I take this view as a base view from which I can nav to full screen views and split containers.
while how can i get the reference to "myApp" in other controller? I tried :
sap.ui.getCore().byId("myApp")
but not work.
Very appreciated if someone give me a hint.
Thanks,
Leon
Hi Leon,
If you want to get the reference in the child view inside the app container.
Try something like below.
this.getView().getParent().getParent();
Regards,
Sarbjeet Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi ,
have one global variable in child view controller and assign the parent controller to this variable while instantiating .
ex:
in child view
sap.ui.core.Control.extend("a.sample.Control", {
appController:null,
init : function() {
// instantiate a sub-control
this._btn = new sap.m.Button();
//access appController here
},
in parent view instantiating child view set the parent controller
this._detailsView = sap.ui.jsview("todolist.details");
this._detailsView.appController = this.getController()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.