Skip to content

Instantly share code, notes, and snippets.

@cschuff
Last active February 7, 2017 08:47
Show Gist options
  • Save cschuff/1649a9a9772caf280c66fe42ef7ffd8f to your computer and use it in GitHub Desktop.
Save cschuff/1649a9a9772caf280c66fe42ef7ffd8f to your computer and use it in GitHub Desktop.
Aggregation types not inherited from sap.ui.base.ManagedObject
constructor: function (sId, mSettings) {
// https://github.com/SAP/openui5/blob/master/src/sap.ui.core/src/sap/ui/base/ManagedObject.js#create
var oMyAggregation;
if ((sId && sId.myAggregation) || (mSettings && mSettings.myAggregation)) {
// delete from settings so that applySettings will not pick it up
if (sId && sId.myAggregation) {
oMyAggregation = sId.myAggregation;
delete sId.myAggregation;
}
if (mSettings && mSettings.myAggregation) {
oMyAggregation = mSettings.myAggregation;
delete mSettings.myAggregation;
}
}
// call parent constructor (that will call init and applySettings in this order)
ManagedObject.apply(this, arguments);
// set manually after applying settings
this.setMyAggregation(oMyAggregation);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment