Ich bin neu bei sapui5, und ich würde gerne wissen, wie man eine Funktion in meiner Init-Methode aufruft?So rufen Sie eine Funktion in der Init-Methode auf?
Der Code, den ich momentan unter:
onInit: function() {
this.oInitialLoadFinishedDeferred = jQuery.Deferred();
var oEventBus = this.getEventBus();
this.getView().byId("list").attachEventOnce("updateFinished", function() {
this.oInitialLoadFinishedDeferred.resolve();
oEventBus.publish("Master", "InitialLoadFinished", {
oListItem: this.getView().byId("list").getItems()[0]
});
}, this);
oEventBus.subscribe("Detail", "TabChanged", this.onDetailTabChanged, this);
//on phones, we will not have to select anything in the list so we don't need to attach to events
if (Device.system.phone) {
return;
}
this.getRouter().attachRoutePatternMatched(this.onRouteMatched, this);
oEventBus.subscribe("Detail", "Changed", this.onDetailChanged, this);
oEventBus.subscribe("Detail", "NotFound", this.onNotFound, this);
oEventBus.subscribe("Detail", "Cancelled", this.onDetailChangeCancelled, this);
// this.handleSelectDialogPress();
}
Irgendwelche Vorschläge?