I got a xml view with a controller, which I create with sap.ui.view()
and then add it to an aggregation of an other view with addDependent()
. In the onInit()
function of the Controller, I do not have a ownercomponent (this.getOwnerComponent() === undefined //true
), since I initialize before I add it as aggregation.
Now I thought to add a Listener (attachEventOnce
) and when added to a Aggregation, do the stuff I need.
Is there a event "OwnerComponentChanged" or something like this? even more important: how can I find out, which event there are and which one to take?
Some.controller.js
var oView = sap.ui.view({viewName : "com.example.app.view.dialog", type : "XML"});
this.getView().addDependent(oView);
dialog.controller.js
(§§§ stands for the searched event)
onInit : function(){
if (this.getOwnerComponent()===undefined) //true
{
this.attachEventOnce("§§§", BaseController.prototype.doSomething, this );
}
}