I've been following the walkthrough tutorial on Step 19: Reuse Dialogs. In the code below, I cannot figure out where the exit
method comes from. I could not find anything in the API reference for ManagedObject.
sap.ui.define([
"sap/ui/base/ManagedObject",
"sap/ui/core/Fragment"
], function (ManagedObject, Fragment) {
"use strict";
return ManagedObject.extend("sap.ui.demo.walkthrough.controller.HelloDialog", {
constructor: function(oView) {
this._oView = oView;
},
exit: function () {
delete this._oView;
},
open: function() {
// ...
}
});
});
If it is not documented in the API reference, how would someone know that exit
is available to override and, more importantly, why not override destroy
instead of exit
? Something like:
// ...
return ManagedObject.extend("sap.ui.demo.walkthrough.controller.HelloDialog", {
constructor: function(oView) {
this._oView = oView;
},
destroy: function() {
delete this._oView;
ManagedObject.prototype.destroy.apply(this, arguments);
},
open: function() {
// ...
}
});
});