Class sap.ui.base.ManagedObjectModule: sap/ui/base/ManagedObject


Base Class that introduces some basic concepts like state management or databinding.

New subclasses of ManagedObject are created with a call to ManagedObject.extend and can make use of the following managed features:

Properties

Managed properties represent the state of a ManagedObject. They can store a single value of a simple data type (like 'string' or 'int'). They have a name (e.g. 'size') and methods to get the current value (getSize) or to set a new value (setSize). When a property is modified, the ManagedObject is marked as invalidated. A managed property can be bound against a property in a sap.ui.model.Model by using the bindProperty method. Updates to the model property will be automatically reflected in the managed property and - if TwoWay databinding is active, changes to the managed property will be reflected in the model. An existing binding can be removed by calling unbindProperty.

If a ManagedObject is cloned, the clone will have the same values for its managed properties as the source of the clone - if the property wasn't bound. If it is bound, the property in the clone will be bound to the same model property as in the source.

Details about the declaration of a managed property, the metadata that describes it and the set of methods that are automatically generated to access it, can be found in the documentation of the extend method.

Aggregations

Managed aggregations can store one or more references to other ManagedObjects. They are a mean to control the lifecycle of the aggregated objects: one ManagedObject can be aggregated by at most one parent ManagedObject at any time. When a ManagedObject is destroyed, all aggregated objects are destroyed as well and the object itself is removed from its parent. That is, aggregations won't contain destroyed objects or null/undefined.

Aggregations have a name ('e.g 'header' or 'items'), a cardinality ('0..1' or '0..n') and are of a specific type (which must be a subclass of ManagedObject as well or a UI5 interface). A ManagedObject will provide methods to set or get the aggregated object for a specific aggregation of cardinality 0..1 (e.g. setHeader, getHeader for an aggregation named 'header'). For an aggregation of cardinality 0..n, there are methods to get all aggregated objects (getItems), to locate an object in the aggregation (e.g. indexOfItem), to add, insert or remove a single aggregated object (addItem, insertItem, removeItem) or to remove or destroy all objects from an aggregation (removeAllItems, destroyItems).

Details about the declaration of a managed aggregation, the metadata that describes it and the set of methods that are automatically generated to access it, can be found in the documentation of the extend method.

Aggregations of cardinality 0..n can be bound to a collection in a model by using bindAggregation (and unbound again using unbindAggregation). For each context in the model collection, a corresponding object will be created in the managed aggregation, either by cloning a template object or by calling a factory function.

Aggregations also control the databinding context of bound objects: by default, aggregated objects inherit all models and binding contexts from their parent object.

When a ManagedObject is cloned, all aggregated objects will be cloned as well - but only if they haven't been added by databinding. In that case, the aggregation in the clone will be bound to the same model collection.

Associations

Managed associations also form a relationship between objects, but they don't define a lifecycle for the associated objects. They even can 'break' in the sense that an associated object might have been destroyed already although it is still referenced in an association. For the same reason, the internal storage for associations are not direct object references but only the IDs of the associated target objects.

Associations have a name ('e.g 'initialFocus'), a cardinality ('0..1' or '0..n') and are of a specific type (which must be a subclass of ManagedObject as well or a UI5 interface). A ManagedObject will provide methods to set or get the associated object for a specific association of cardinality 0..1 (e.g. setInitialFocus, getInitialFocus). For an association of cardinality 0..n, there are methods to get all associated objects (getRefItems), to add, insert or remove a single associated object (addRefItem, insertRefItem, removeRefItem) or to remove all objects from an association (removeAllRefItems).

Details about the declaration of a managed association, the metadata that describes it and the set of methods that are automatically generated to access it, can be found in the documentation of the extend method.

Associations can't be bound to the model.

When a ManagedObject is cloned, the result for an association depends on the relationship between the associated target object and the root of the clone operation: if the associated object is part of the to-be-cloned object tree (reachable via aggregations from the root of the clone operation), then the cloned association will reference the clone of the associated object. Otherwise it will reference the same object as in the original tree. When a ManagedObject is destroyed, other objects that are only associated, are not affected by the destroy operation.

Events

Managed events provide a mean for communicating important state changes to an arbitrary number of 'interested' listeners. Events have a name and (optionally) a set of parameters. For each event there will be methods to add or remove an event listener as well as a method to fire the event. (e.g. attachChange, detachChange, fireChange for an event named 'change').

Details about the declaration of a managed events, the metadata that describes it and the set of methods that are automatically generated to access it, can be found in the documentation of the extend method.

When a ManagedObject is cloned, all listeners registered for any event in the clone source are also registered to the clone. Later changes are not reflected in any direction (neither from source to clone nor vice versa).

Low Level APIs:

The prototype of ManagedObject provides several generic, low level APIs to manage properties, aggregations, associations and events. These generic methods are solely intended for implementing higher level, non-generic methods that manage a single managed property etc. (e.g. a function setSize(value) that sets a new value for property 'size'). sap.ui.base.ManagedObject.extend creates default implementations of those higher level APIs for all managed aspects. The implementation of a subclass then can override those default implementations with a more specific implementation, e.g. to implement a side effect when a specific property is set or retrieved. It is therefore important to understand that the generic low-level methods ARE NOT SUITABLE FOR GENERIC ACCESS to the state of a managed object, as that would bypass the overriding higher level methods and their side effects.

Constructor Summary
new sap.ui.base.ManagedObject(sId?, mSettings?, oScope?)Constructs and initializes a managed object with the given sId and settings.
Event Summary
formatError(oControlEvent)Fired when a new value for a bound property should have been propagated from the model, but formatting the value failed with an exception.
modelContextChange(oControlEvent)Fired when models or contexts are changed on this object (either by calling setModel/setBindingContext or due to propagation)
parseError(oControlEvent)Fired when a new value for a bound property should have been propagated to the model, but parsing the value failed with an exception.
validationError(oControlEvent)Fired when a new value for a bound property should have been propagated to the model, but validating the value failed with an exception.
validationSuccess(oControlEvent)Fired after a new value for a bound property has been propagated to the model.
Method Summary
sap.ui.base.ManagedObject.create(vData, oKeyInfo?, oScope?)Creates a new ManagedObject from the given data.
sap.ui.base.ManagedObject.extend(sClassName, oClassInfo?, FNMetaImpl?)Defines a new subclass of ManagedObject with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.base.ManagedObject.getMetadata()Returns the metadata for the ManagedObject class.
addAggregation(sAggregationName, oObject, bSuppressInvalidate?)Adds some entity oObject to the aggregation identified by sAggregationName.
addAssociation(sAssociationName, sId, bSuppressInvalidate?)Adds some object with the ID sId to the association identified by sAssociationName and marks this ManagedObject as changed.
applySettings(mSettings, oScope?)Sets all the properties, aggregations, associations and event handlers as given in the object literal mSettings.
attachFormatError(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the formatError event of this sap.ui.base.ManagedObject.
attachModelContextChange(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the modelContextChange event of this sap.ui.base.ManagedObject.
attachParseError(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the parseError event of this sap.ui.base.ManagedObject.
attachValidationError(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the validationError event of this sap.ui.base.ManagedObject.
attachValidationSuccess(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the validationSuccess event of this sap.ui.base.ManagedObject.
bindAggregation(sName, oBindingInfo)Bind an aggregation to the model.
bindObject(vPath, mParameters?)Bind the object to the referenced entity in the model, which is used as the binding context to resolve bound properties or aggregations of the object itself and all of its children relatively to the given path.
bindProperty(sName, oBindingInfo)Binds a property to the model.
clone(sIdSuffix?, aLocalIds?, oOptions?, cloneChildren?, cloneBindings?)Clones a tree of objects starting with the object on which clone is called first (root object).
destroy(bSuppressInvalidate?)Cleans up the resources associated with this object and all its aggregated children.
destroyAggregation(sAggregationName, bSuppressInvalidate?)Destroys (all) the managed object(s) in the aggregation named sAggregationName and empties the aggregation.
detachFormatError(fnFunction, oListener)Detaches event handler fnFunction from the formatError event of this sap.ui.base.ManagedObject.
detachModelContextChange(fnFunction, oListener)Detaches event handler fnFunction from the modelContextChange event of this sap.ui.base.ManagedObject.
detachParseError(fnFunction, oListener)Detaches event handler fnFunction from the parseError event of this sap.ui.base.ManagedObject.
detachValidationError(fnFunction, oListener)Detaches event handler fnFunction from the validationError event of this sap.ui.base.ManagedObject.
detachValidationSuccess(fnFunction, oListener)Detaches event handler fnFunction from the validationSuccess event of this sap.ui.base.ManagedObject.
findAggregatedObjects(bRecursive, fnCondition?)Searches and returns all aggregated objects that pass the given check function.
fireFormatError(mParameters?)Fires event formatError to attached listeners.
fireModelContextChange(mParameters?)Fires event modelContextChange to attached listeners.
fireParseError(mParameters?)Fires event parseError to attached listeners.
fireValidationError(mParameters?)Fires event validationError to attached listeners.
fireValidationSuccess(mParameters?)Fires event validationSuccess to attached listeners.
getAggregation(sAggregationName, oDefaultForCreation)Returns the aggregated object(s) for the named aggregation of this ManagedObject.
getAssociation(sAssociationName, oDefaultForCreation)Returns the content of the association with the given name.
getBinding(sName)Get the binding object for a specific aggregation/property
getBindingContext(sModelName?)Get the binding context of this object for the given model name.
getBindingInfo(sName)Returns the binding infos for the given property or aggregation.
getBindingPath(sName)Get the binding path for a specific aggregation/property
getEventingParent()Returns the parent managed object as new eventing parent to enable control event bubbling or null if this object hasn't been added to a parent yet.
getId()Returns the object's Id.
getMetadata()Returns the metadata for the class that this object belongs to.
getModel(sName?)Get the model to be used for data bindings with the given model name.
getObjectBinding(sModelName)Get the object binding object for a specific model
getOriginInfo(sPropertyName)Returns the origin info for the value of the given property.
getParent()Returns the parent managed object or null if this object hasn't been added to a parent yet.
getProperty(sPropertyName)Returns the value for the property with the given sPropertyName.
hasModel()Check if any model is set to the ManagedObject or to one of its parents (including UIArea and Core).
indexOfAggregation(sAggregationName, oObject)Searches for the provided ManagedObject in the named aggregation and returns its 0-based index if found, or -1 otherwise.
insertAggregation(sAggregationName, oObject, iIndex, bSuppressInvalidate?)Inserts managed object oObject to the aggregation named sAggregationName at position iIndex.
invalidate()This triggers rerendering of itself and its children.
isBound(sName)Find out whether a property or aggregation is bound
isInvalidateSuppressed()Returns whether rerendering is currently suppressed on this ManagedObject
isPropertyInitial(sPropertyName)Returns whether the given property value is initial and has not been explicitly set or bound.
isTreeBinding(sName)This method is used internally and should only be overridden by a tree managed object which utilizes the tree binding.
propagateMessages(sName, aMessages)Generic method which is called, whenever messages for this object exists.
refreshAggregation(sName)Generic method which can be called, when an aggregation needs to be refreshed.
removeAggregation(sAggregationName, vObject, bSuppressInvalidate?)Removes an object from the aggregation named sAggregationName with cardinality 0.
removeAllAggregation(sAggregationName, bSuppressInvalidate?)Removes all objects from the 0.
removeAllAssociation(sAssociationName, bSuppressInvalidate?)Removes all the objects in the 0.
removeAssociation(sAssociationName, vObject, bSuppressInvalidate?)Removes a ManagedObject from the association named sAssociationName.
resetProperty(sPropertyName)Resets the given property to the default value and also restores the "initial" state (like it has never been set).
setAggregation(sAggregationName, oObject, bSuppressInvalidate?)Sets a new object in the named 0.
setAssociation(sAssociationName, sId, bSuppressInvalidate?)Sets the associated object for the given managed association of cardinality '0.
setBindingContext(oContext, sModelName?)Set the binding context for this ManagedObject for the model with the given name.
setModel(oModel, sName?)Sets or unsets a model for the given model name for this ManagedObject.
setProperty(sPropertyName, oValue, bSuppressInvalidate?)Sets the given value for the given property after validating and normalizing it, marks this object as changed.
toString()Returns a simple string representation of this managed object.
unbindAggregation(sName, bSuppressReset)Unbind the aggregation from the model
unbindObject(sModelName?)Removes the defined binding context of this object, all bindings will now resolve relative to the parent context again.
unbindProperty(sName, bSuppressReset)Unbind the property from the model
updateAggregation(sName)Generic method which is called whenever an aggregation binding has changed.
validateAggregation(sAggregationName, oObject, bMultiple)Checks whether the given value is of the proper type for the given aggregation name.
validateProperty(sPropertyName, oValue)Checks whether the given value is of the proper type for the given property name.
bindContext(sPath)Bind the object to the referenced entity in the model, which is used as the binding context to resolve bound properties or aggregations of the object itself and all of its children relatively to the given path.
unbindContext(sModelName?)Removes the defined binding context of this object, all bindings will now resolve relative to the parent context again.
Methods borrowed from class sap.ui.base.Object
Constructor Detail
new sap.ui.base.ManagedObject(sId?, mSettings?, oScope?)

Constructs and initializes a managed object with the given sId and settings.

If the optional mSettings are given, they must be a simple object that defines values for properties, aggregations, associations or events keyed by their name.

Valid Names and Value Ranges:

The property (key) names supported in the object literal are exactly the (case sensitive) names documented in the JSDoc for the properties, aggregations, associations and events of the current class and its base classes. Note that for 0..n aggregations and associations this name usually is the plural name, whereas it is the singular name in case of 0..1 relations.

If a key name is ambiguous for a specific managed object class (e.g. a property has the same name as an event), then this method prefers property, aggregation, association and event in that order. To resolve such ambiguities, the keys can be prefixed with aggregation:, association: or event: (such keys containing a colon (':') must be quoted to be valid Javascript).

The possible values for a setting depend on its kind:

  • for simple properties, the value has to match the documented type of the property (no type conversion occurs)
  • for 0..1 aggregations, the value has to be an instance of the aggregated type
  • for 0..n aggregations, the value has to be an array of instances of the aggregated type or a single instance
  • for 0..1 associations, an instance of the associated type or an id (string) is accepted
  • for 0..n associations, an array of instances of the associated type or of IDs is accepted
  • for events either a function (event handler) is accepted or an array of length 2 where the first element is a function and the 2nd element is an object to invoke the method on.

Each subclass should document the name and type of its supported settings in its constructor documentation.

Besides the settings documented below, ManagedObject itself supports the following special settings:

  • id : sap.ui.core.ID an ID for the new instance. Some subclasses (Element, Component) require the id to be unique in a specific scope (e.g. an Element Id must be unique across all Elements, a Component id must be unique across all Components).
  • models : object a map of sap.ui.model.Model instances keyed by their model name (alias). Each entry with key k in this object has the same effect as a call this.setModel(models[k], k);.
  • bindingContexts : object a map of sap.ui.model.Context instances keyed by their model name. Each entry with key k in this object has the same effect as a call this.setBindingContext(bindingContexts[k], k);
  • objectBindings : object a map of binding paths keyed by the corresponding model name. Each entry with key k in this object has the same effect as a call this.bindObject(objectBindings[k], k);
  • metadataContexts : object a map of binding paths keyed by the corresponding model name.

The supported settings are:

  • Events

    • validationSuccess : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • validationError : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • parseError : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • formatError : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • modelContextChange : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

Parameters:
stringsId?id for the new managed object; generated automatically if no non-empty id is given Note: this can be omitted, no matter whether mSettings will be given or not!
objectmSettings?Optional map/JSON-object with initial property values, aggregated objects etc. for the new object
objectoScope?Scope object for resolving string based type and formatter references in bindings. When a scope object is given, mSettings cannot be omitted, at least null or an empty object literal must be given.
Event Detail
formatError(oControlEvent)
Fired when a new value for a bound property should have been propagated from the model, but formatting the value failed with an exception.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
sap.ui.base.ManagedObjectoControlEvent.getParameters.elementManagedObject instance whose property should have received the model update.
stringoControlEvent.getParameters.propertyName of the property for which the binding should have been updated.
sap.ui.model.TypeoControlEvent.getParameters.typeData type used in the binding (if any).
anyoControlEvent.getParameters.newValueNew value (model representation) as propagated from the model.
anyoControlEvent.getParameters.oldValueOld value (external representation) as previously stored in the ManagedObject.
modelContextChange(oControlEvent)
Fired when models or contexts are changed on this object (either by calling setModel/setBindingContext or due to propagation)
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
parseError(oControlEvent)
Fired when a new value for a bound property should have been propagated to the model, but parsing the value failed with an exception.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
sap.ui.base.ManagedObjectoControlEvent.getParameters.elementManagedObject instance whose property initiated the model update.
stringoControlEvent.getParameters.propertyName of the property for which the bound model property should have been been updated.
sap.ui.model.TypeoControlEvent.getParameters.typeData type used in the binding.
anyoControlEvent.getParameters.newValueNew value (external representation) as parsed by the binding.
anyoControlEvent.getParameters.oldValueOld value (external representation) as previously stored in the ManagedObject.
stringoControlEvent.getParameters.messageLocalized message describing the parse error
validationError(oControlEvent)
Fired when a new value for a bound property should have been propagated to the model, but validating the value failed with an exception.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
sap.ui.base.ManagedObjectoControlEvent.getParameters.elementManagedObject instance whose property initiated the model update.
stringoControlEvent.getParameters.propertyName of the property for which the bound model property should have been been updated.
sap.ui.model.TypeoControlEvent.getParameters.typeData type used in the binding.
anyoControlEvent.getParameters.newValueNew value (external representation) as parsed and validated by the binding.
anyoControlEvent.getParameters.oldValueOld value (external representation) as previously stored in the ManagedObject.
stringoControlEvent.getParameters.messageLocalized message describing the validation issues
validationSuccess(oControlEvent)
Fired after a new value for a bound property has been propagated to the model. Only fired, when the binding uses a data type.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
sap.ui.base.ManagedObjectoControlEvent.getParameters.elementManagedObject instance whose property initiated the model update.
stringoControlEvent.getParameters.propertyName of the property for which the bound model property has been updated.
sap.ui.model.TypeoControlEvent.getParameters.typeData type used in the binding.
anyoControlEvent.getParameters.newValue

New value (external representation) as propagated to the model.

Note: the model might modify (normalize) the value again and this modification will be stored in the ManagedObject. The 'newValue' parameter of this event contains the value before such a normalization.

anyoControlEvent.getParameters.oldValueOld value (external representation) as previously stored in the ManagedObject.
Method Detail
sap.ui.base.ManagedObject.create(vData, oKeyInfo?, oScope?)

Creates a new ManagedObject from the given data.

If vData is a managed object already, that object is returned. If vData is an object (literal), then a new object is created with vData as settings. The type of the object is either determined by a property of name Type (capital 'T') in the vData or by a property type (lower case 't') in the oKeyInfo object. In both cases, the type can be specified by name (dot separated name of the class) or by the constructor function of the class.

Parameters:
sap.ui.base.ManagedObject|objectvDatathe data to create the object from
objectoKeyInfo?
objectoScope?Scope object to resolve types and formatters in bindings
sap.ui.base.ManagedObject.extend(sClassName, oClassInfo?, FNMetaImpl?): function

Defines a new subclass of ManagedObject with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo can contain the same information that sap.ui.base.Object.extend already accepts, plus the following new properties in the 'metadata' object literal:

  • library : string
  • properties : object
  • defaultProperty : string
  • aggregations : object
  • defaultAggregation : string
  • associations : object
  • events : object
  • specialSettings : object// this one is still experimental and not for public usage!

Each of these properties is explained in more detail lateron.

Example:

ManagedObect.extend('sap.mylib.MyClass', {
  metadata : {
    library: 'sap.mylib',
    properties : {
      value: 'string',
      width: 'sap.ui.core.CSSSize',
      height: { type: 'sap.ui.core.CSSSize', defaultValue: '100%' }
    },
    defaultProperty : 'value',
    aggregations : {
      header : { type: 'sap.mylib.FancyHeader', multiple : false }
      items : 'sap.ui.core.Control'
    },
    defaultAggregation : 'items',
    associations : {
      initiallyFocused : { type: 'sap.ui.core.Control' }
    },
    events: {
      beforeOpen : {
        parameters : {
          opener : 'sap.ui.core.Control'
        }
      }
    },
  },

  init: function() {
  }

}); // end of 'extend' call

Detailed explanation of properties

'library' : string
Name of the library that the new subclass should belong to. If the subclass is a control or element, it will automatically register with that library so that authoring tools can discover it. By convention, the name of the subclass should have the library name as a prefix, e.g. 'sap.ui.commons.Panel' belongs to library 'sap.ui.commons'.

'properties' : object
An object literal whose properties each define a new managed property in the ManagedObject subclass. The value can either be a simple string which then will be assumed to be the type of the new property or it can be an object literal with the following properties

  • type: string type of the new property. Must either be one of the built-in types 'string', 'boolean', 'int', 'float', 'object' or 'any', or a type created and registered with sap.ui.base.DataType.createType or an array type based on one of the previous types.
  • group:string a semantic grouping of the properties, intended to be used in design time tools. Allowed values are (case sensitive): Accessibility, Appearance, Behavior, Data, Designtime, Dimension, Identification, Misc
  • defaultValue: any the default value for the property or null if there is no defaultValue.
  • bindable: boolean|string (either can be omitted or set to the boolean value true or the magic string 'bindable') If set to true or 'bindable', additional named methods bindName and unbindName are generated as convenience. Despite its name, setting this flag is not mandatory to make the managed property bindable. The generic methods bindProperty and unbindProperty can always be used.

Property names should use camelCase notation, start with a lowercase letter and only use characters from the set [a-zA-Z0-9_$]. If an aggregation in the literal is preceded by a JSDoc comment (doclet) and if the UI5 plugin and template are used for JSDoc3 generation, the doclet will be used as generic documentation of the aggregation.

For each public property 'foo', the following methods will be created by the "extend" method and will be added to the prototype of the subclass:

  • getFoo() - returns the current value of property 'foo'. Internally calls getProperty
  • setFoo(v) - sets 'v' as the new value of property 'foo'. Internally calls setProperty
  • bindFoo(c) - (only if property was defined to be 'bindable'): convenience function that wraps bindProperty
  • unbindFoo() - (only if property was defined to be 'bindable'): convenience function that wraps unbindProperty

'defaultProperty' : string
When specified, the default property must match the name of one of the properties defined for the new subclass (either own or inherited). The named property can be used to identify the main property to be used for bound data. E.g. the value property of a field control.

'aggregations' : object
An object literal whose properties each define a new aggregation in the ManagedObject subclass. The value can either be a simple string which then will be assumed to be the type of the new aggregation or it can be an object literal with the following properties

  • type: string type of the new aggregation. must be the full global name of a ManagedObject subclass (in dot notation, e.g. 'sap.m.Button')
  • [multiple]: boolean whether the aggregation is a 0..1 (false) or a 0..n aggregation (true), defaults to true
  • [singularName]: string. Singular name for 0..n aggregations. For 0..n aggregations the name by convention should be the plural name. Methods affecting multiple objects in an aggregation will use the plural name (e.g. getItems(), whereas methods that deal with a single object will use the singular name (e.g. addItem). The framework knows a set of common rules for building plural form of English nouns and uses these rules to determine a singular name on its own. if that name is wrong, a singluarName can be specified with this property.
  • [visibility]: string either 'hidden' or 'public', defaults to 'public'. Aggregations that belong to the API of a class must be 'public' whereas 'hidden' aggregations typically are used for the implementation of composite classes (e.g. composite controls)
  • bindable: boolean|string (either can be omitted or set to the boolean value true or the magic string 'bindable') If set to true or 'bindable', additional named methods bindName and unbindName are generated as convenience. Despite its name, setting this flag is not mandatory to make the managed aggregation bindable. The generic methods bindAggregation and unbindAggregation can always be used.

Aggregation names should use camelCase notation, start with a lowercase letter and only use characters from the set [a-zA-Z0-9_$]. The name for a hidden aggregations might start with an underscore. If an aggregation in the literal is preceded by a JSDoc comment (doclet) and if the UI5 plugin and template are used for JSDoc3 generation, the doclet will be used as generic documentation of the aggregation.

For each public aggregation 'item' of cardinality 0..1, the following methods will be created by the "extend" method and will be added to the prototype of the subclass:

  • getItem() - returns the current value of aggregation 'item'. Internally calls getAggregation with a default value of undefined
  • setItem(o) - sets 'o' as the new aggregated object in aggregation 'item'. Internally calls setAggregation
  • destroyItem(o) - destroy a currently aggregated object in aggregation 'item' and clears the aggregation. Internally calls destroyAggregation
  • bindItem(c) - (only if aggregation was defined to be 'bindable'): convenience function that wraps bindAggregation
  • unbindItem() - (only if aggregation was defined to be 'bindable'): convenience function that wraps unbindAggregation

For a public aggregation 'items' of cardinality 0..n, the following methods will be created:

  • getItems() - returns an array with the objects contained in aggregation 'items'. Internally calls getAggregation with a default value of []
  • addItem(o) - adds an object as last element in the aggregation 'items'. Internally calls addAggregation
  • insertItem(o,p) - inserts an object into the aggregation 'items'. Internally calls insertAggregation
  • removeItem(v) - removes an object from the aggregation 'items'. Internally calls removeAggregation
  • removeItems() - removes all object from the aggregation 'items'. Internally calls removeAllAggregation
  • destroyItems() - destroy all currently aggregated objects in aggregation 'items' and clears the aggregation. Internally calls destroyAggregation
  • bindItems(c) - (only if aggregation was defined to be 'bindable'): convenience function that wraps bindAggregation
  • unbindItems() - (only if aggregation was defined to be 'bindable'): convenience function that wraps unbindAggregation

For private or hidden aggregations, no methods are generated.

'defaultAggregation' : string
When specified, the default aggregation must match the name of one of the aggregations defined for the new subclass (either own or inherited). The named aggregation will be used in contexts where no aggregation is specified. E,g. when an object in an XMLView embeds other objects without naming an aggregation, as in the following example:

 <!-- assuming the defaultAggregation for Dialog is 'content' -->
 <Dialog>
   <Text/>
   <Button/>
 </Dialog>

'associations' : object
An object literal whose properties each define a new association of the ManagedObject subclass. The value can either be a simple string which then will be assumed to be the type of the new association or it can be an object literal with the following properties

  • type: string type of the new association
  • multiple: boolean whether the association is a 0..1 (false) or a 0..n association (true), defaults to false(1) for associations
  • [singularName]: string. Singular name for 0..n associations. For 0..n associations the name by convention should be the plural name. Methods affecting multiple objects in an association will use the plural name (e.g. getItems(), whereas methods that deal with a single object will use the singular name (e.g. addItem). The framework knows a set of common rules for building plural form of English nouns and uses these rules to determine a singular name on its own. if that name is wrong, a singluarName can be specified with this property.

Association names should use camelCase notation, start with a lowercase letter and only use characters from the set [a-zA-Z0-9_$]. If an association in the literal is preceded by a JSDoc comment (doclet) and if the UI5 plugin and template are used for JSDoc3 generation, the doclet will be used as generic documentation of the association.

For each association 'ref' of cardinality 0..1, the following methods will be created by the "extend" method and will be added to the prototype of the subclass:

  • getRef() - returns the current value of association 'item'. Internally calls getAssociation with a default value of undefined
  • setRef(o) - sets 'o' as the new associated object in association 'item'. Internally calls setAssociation

For a public association 'refs' of cardinality 0..n, the following methods will be created:

  • getRefs() - returns an array with the objects contained in association 'items'. Internally calls getAssociation with a default value of []
  • addRef(o) - adds an object as last element in the association 'items'. Internally calls addAssociation
  • removeRef(v) - removes an object from the association 'items'. Internally calls removeAssociation
  • removeAllRefs() - removes all objects from the association 'items'. Internally calls removeAllAssociation

'events' : object
An object literal whose properties each define a new event of the ManagedObject subclass. The value can either be a simple string which then will be assumed to be the type of the new association or it can be an object literal with the following properties

  • allowPreventDefault: boolean whether the event allows to prevented the default behavior of the event source
  • parameters: object an object literal that describes the parameters of this event.

Event names should use camelCase notation, start with a lowercase letter and only use characters from the set [a-zA-Z0-9_$]. If an event in the literal is preceded by a JSDoc comment (doclet) and if the UI5 plugin and template are used for JSDoc3 generation, the doclet will be used as generic documentation of the event.

For each event 'Some' the following methods will be created by the "extend" method and will be added to the prototype of the subclass:

  • attachSome(fn,o) - registers a listener for the event. Internally calls attachEvent
  • detachSome(fn,o) - deregisters a listener for the event. Internally calls detachEvent
  • fireSome() - fire the event. Internally calls fireEvent

'specialSettings' : object
Special settings are an experimental feature and MUST NOT BE USED by controls or applications outside of the sap.ui.core project.

Parameters:
stringsClassNamename of the class to be created
objectoClassInfo?object literal with informations about the class
functionFNMetaImpl?constructor function for the metadata object. If not given, it defaults to sap.ui.base.ManagedObjectMetadata.
Returns:
functionthe created class / constructor function
sap.ui.base.ManagedObject.getMetadata(): sap.ui.base.ManagedObjectMetadata
Returns the metadata for the ManagedObject class.
Returns:
sap.ui.base.ManagedObjectMetadataMetadata for the ManagedObject class.
addAggregation(sAggregationName, oObject, bSuppressInvalidate?): sap.ui.base.ManagedObject

Adds some entity oObject to the aggregation identified by sAggregationName.

If the given object is not valid with regard to the aggregation (if it is not an instance of the type specified for that aggregation) or when the method is called for an aggregation of cardinality 0..1, then an Error is thrown (see validateAggregation.

If the aggregation already has content, the new object will be added after the current content. If the new object was already contained in the aggregation, it will be moved to the end.

Note: This method is a low-level API as described in the class documentation. Applications or frameworks must not use this method to generically add an object to an aggregation. Use the concrete method addXYZ for aggregation 'XYZ' or the generic applySettings instead.

Parameters:
stringsAggregationNamethe string identifying the aggregation that oObject should be added to.
sap.ui.base.ManagedObjectoObjectthe object to add; if empty, nothing is added
booleanbSuppressInvalidate?if true, this ManagedObject as well as the added child are not marked as changed
Returns:
sap.ui.base.ManagedObjectReturns this to allow method chaining
addAssociation(sAssociationName, sId, bSuppressInvalidate?): sap.ui.base.ManagedObject

Adds some object with the ID sId to the association identified by sAssociationName and marks this ManagedObject as changed.

This method does not avoid duplicates.

Note: This method is a low-level API as described in the class documentation. Applications or frameworks must not use this method to generically add an object to an association. Use the concrete method addXYZ for association 'XYZ' or the generic applySettings instead.

Parameters:
stringsAssociationNamethe string identifying the association the object should be added to.
string|sap.ui.base.ManagedObjectsIdthe ID of the ManagedObject object to add; if empty, nothing is added; if a sap.ui.base.ManagedObject is given, its ID is added
booleanbSuppressInvalidate?if true, this managed object as well as the newly associated object are not marked as changed
Returns:
sap.ui.base.ManagedObjectReturns this to allow method chaining
applySettings(mSettings, oScope?): sap.ui.base.ManagedObject

Sets all the properties, aggregations, associations and event handlers as given in the object literal mSettings. If a property, aggregation, etc. is not listed in mSettings, then its value is not changed by this method.

For properties and 0..1 aggregations/associations, any given setting overwrites the current value. For 0..n aggregations, the given values are appended; event listeners are registered in addition to existing ones.

For the possible keys and values in mSettings see the general documentation in sap.ui.base.ManagedObject or the specific documentation of the constructor of the concrete managed object class.

Parameters:
objectmSettingsthe settings to apply to this managed object
objectoScope?Scope object to resolve types and formatters
Returns:
sap.ui.base.ManagedObjectReturns this to allow method chaining
attachFormatError(oData?, fnFunction, oListener?): sap.ui.base.ManagedObject

Attaches event handler fnFunction to the formatError event of this sap.ui.base.ManagedObject.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.base.ManagedObject itself.

Fired when a new value for a bound property should have been propagated from the model, but formatting the value failed with an exception.

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.ui.base.ManagedObject itself
Returns:
sap.ui.base.ManagedObjectReference to this in order to allow method chaining
attachModelContextChange(oData?, fnFunction, oListener?): sap.ui.base.ManagedObject

Attaches event handler fnFunction to the modelContextChange event of this sap.ui.base.ManagedObject.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.base.ManagedObject itself.

Fired when models or contexts are changed on this object (either by calling setModel/setBindingContext or due to propagation)

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.ui.base.ManagedObject itself
Returns:
sap.ui.base.ManagedObjectReference to this in order to allow method chaining
attachParseError(oData?, fnFunction, oListener?): sap.ui.base.ManagedObject

Attaches event handler fnFunction to the parseError event of this sap.ui.base.ManagedObject.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.base.ManagedObject itself.

Fired when a new value for a bound property should have been propagated to the model, but parsing the value failed with an exception.

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.ui.base.ManagedObject itself
Returns:
sap.ui.base.ManagedObjectReference to this in order to allow method chaining
attachValidationError(oData?, fnFunction, oListener?): sap.ui.base.ManagedObject

Attaches event handler fnFunction to the validationError event of this sap.ui.base.ManagedObject.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.base.ManagedObject itself.

Fired when a new value for a bound property should have been propagated to the model, but validating the value failed with an exception.

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.ui.base.ManagedObject itself
Returns:
sap.ui.base.ManagedObjectReference to this in order to allow method chaining
attachValidationSuccess(oData?, fnFunction, oListener?): sap.ui.base.ManagedObject

Attaches event handler fnFunction to the validationSuccess event of this sap.ui.base.ManagedObject.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.base.ManagedObject itself.

Fired after a new value for a bound property has been propagated to the model. Only fired, when the binding uses a data type.

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.ui.base.ManagedObject itself
Returns:
sap.ui.base.ManagedObjectReference to this in order to allow method chaining
bindAggregation(sName, oBindingInfo): sap.ui.base.ManagedObject

Bind an aggregation to the model.

The bound aggregation will use the given template, clone it for each item which exists in the bound list and set the appropriate binding context. This is a generic method which can be used to bind any aggregation to the model. A managed object may flag aggregations in the metamodel with bindable="bindable" to get typed bindSomething methods for those aggregations.

Parameters:
stringsNamethe aggregation to bind
objectoBindingInfothe binding info
stringoBindingInfo.paththe binding path
sap.ui.base.ManagedObjectoBindingInfo.templatethe template to clone for each item in the aggregation
booleanoBindingInfo.templateShareable?, Default: trueoption to enable that the template will be shared which means that it won't be destroyed or cloned automatically
functionoBindingInfo.factorythe factory function
numberoBindingInfo.startIndexthe first entry of the list to be created
numberoBindingInfo.lengththe amount of entries to be created (may exceed the size limit of the model)
sap.ui.model.Sorter|sap.ui.model.Sorter[]oBindingInfo.sorter?the initial sort order (optional)
sap.ui.model.Filter[]oBindingInfo.filters?the predefined filters for this aggregation (optional)
string|functionoBindingInfo.keythe name of the key property or a function getting the context as only parameter to calculate a key for entries. This can be used to improve update behaviour in models, where a key is not already available.
objectoBindingInfo.parameters?a map of parameters which is passed to the binding. The supported parameters are listed in the corresponding model-specific implementation of sap.ui.model.ListBinding or sap.ui.model.TreeBinding.
functionoBindingInfo.groupHeaderFactory?a factory function to generate custom group visualization (optional)
Returns:
sap.ui.base.ManagedObjectreference to the instance itself
bindObject(vPath, mParameters?): sap.ui.base.ManagedObject
Bind the object to the referenced entity in the model, which is used as the binding context to resolve bound properties or aggregations of the object itself and all of its children relatively to the given path. If a relative binding path is used, this will be applied whenever the parent context changes. There is no difference between sap.ui.core.Element#bindElement and sap.ui.base.ManagedObject#bindObject.
Parameters:
string|objectvPaththe binding path or an object with more detailed binding options
stringvPath.paththe binding path
objectvPath.parameters?map of additional parameters for this binding
stringvPath.model?name of the model
objectvPath.events?map of event listeners for the binding events
objectmParameters?map of additional parameters for this binding (only taken into account when vPath is a string in that case the properties described for vPath above are valid here). The supported parameters are listed in the corresponding model-specific implementation of sap.ui.model.ContextBinding.
Returns:
sap.ui.base.ManagedObjectreference to the instance itself
bindProperty(sName, oBindingInfo): sap.ui.base.ManagedObject

Binds a property to the model.

The Setter for the given property will be called with the value retrieved from the data model. When the binding mode is OneTime, the property will be set only once. When it is OneWay, the property will be updated whenever the corresponding data in the model changes. In mode TwoWay, changes to the property (not originating in the model) will be reported back to the model (typical use case: user interaction changes the value of a control).

This is a generic method which can be used to bind any property to the model. A managed object may flag any property in its metadata with bindable="bindable" to additionally provide named methods to bind and unbind the corresponding property.

Composite Binding
A composite property binding which combines data from multiple model paths can be declared using the parts parameter instead of path. The formatter function or a composite type then can be used to combine the parts, Properties with a composite binding are also known as "calculated fields".

Example:

  oTxt.bindValue({
    parts: [
      {path: "/firstName", type: "sap.ui.model.type.String"},
      {path: "myModel2>/lastName"}
    ]
  });

Note that a composite binding will be forced into mode OneWay when one of the binding parts is not in mode TwoWay.

Formatter Functions
When a formatter function is specified for the binding or for a binding part, it will be called with the value of the bound model property. After setting the initial property value, the formatter function will only be called again when the bound model property changes (simple property binding) or when at least one of the bound model properties changes (formatter function of a composite binding). Note that a binding only monitors the bound model data for changes. Dependencies of the formatter implementation to other model data is not known to the binding and changes won't be detected.

When the formatter for a property binding (simple or composite) is called, the managed object will be given as this context. For formatters of binding parts in a composite binding, this is not the case.

Parameters:
stringsNameName of the property to bind
objectoBindingInfoBinding information
stringoBindingInfo.pathPath in the model to bind to, either an absolute path or relative to the binding context for the corresponding model
stringoBindingInfo.model?Name of the model to bind against or undefined for the default model
functionoBindingInfo.formatter?Function to convert model data into a property value
booleanoBindingInfo.useRawValues?

Whether the parameters to the formatter function should be passed as raw values. In this case the specified types for the binding parts are not used and the values are not formatted.

Note: use this flag only when using multiple bindings. If you use only one binding and want raw values then simply don't specify a type for that binding.

booleanoBindingInfo.useInternalValues?

Whether the parameters to the formatter function should be passed as the related JavaScript primitive values. In this case the values of the model are parsed by the model format of the specified types from the binding parts.

Note: use this flag only when using multiple bindings.

sap.ui.model.Type|stringoBindingInfo.type?A type object or the name of a type class to create such a type object; the type will be used for converting model data to a property value (aka "formatting") and vice versa (in binding mode TwoWay, aka "parsing")
stringoBindingInfo.targetType?Target type to be used by the type when formatting model data, for example "boolean" or "string" or "any"; defaults to the property's type
objectoBindingInfo.formatOptions?Format options to be used for the type; only taken into account when the type is specified by its name - a given type object won't be modified
objectoBindingInfo.constraints?Additional constraints to be used when constructing a type object from a type name, ignored when a type object is given
sap.ui.model.BindingModeoBindingInfo.mode?, Default: DefaultBinding mode to be used for this property binding (e.g. one way)
objectoBindingInfo.parameters?Map of parameters which is passed to the binding; the supported parameters are listed in the corresponding model-specific implementation of sap.ui.model.PropertyBinding.
object[]oBindingInfo.parts?

Array of binding info objects for the parts of a composite binding; the structure of each binding info is the same as described for the oBindingInfo as a whole.

Note: recursive composite bindings are currently not supported

Returns:
sap.ui.base.ManagedObjectreference to the instance itself
clone(sIdSuffix?, aLocalIds?, oOptions?, cloneChildren?, cloneBindings?): sap.ui.base.ManagedObject

Clones a tree of objects starting with the object on which clone is called first (root object).

The IDs within the newly created clone tree are derived from the original IDs by appending the given sIdSuffix (if no suffix is given, one will be created; it will be unique across multiple clone calls).

The oOptions configuration object can have the following properties:

  • The boolean value cloneChildren specifies whether associations/aggregations will be cloned
  • The boolean value cloneBindings specifies if bindings will be cloned

For each cloned object the following settings are cloned based on the metadata of the object and the defined options:

  • all properties that are not bound. If cloneBinding is false, even these properties will be cloned; the values are used by reference, they are not cloned
  • all aggregated objects that are not bound. If cloneBinding is false, even the ones that are bound will be cloned; they are all cloned recursively using the same sIdSuffix
  • all associated controls; when an association points to an object inside the cloned object tree, then the cloned association will be modified to that it points to the clone of the target object. When the association points to a managed object outside of the cloned object tree, then its target won't be changed.
  • all models set via setModel(); used by reference
  • all property and aggregation bindings (if cloneBindings is true); the pure binding information (path, model name) is cloned, but all other information like template control or factory function, data type or formatter function are copied by reference. The bindings themselves are created anew as they are specific for the combination (object, property, model). As a result, any later changes to a binding of the original object are not reflected in the clone, but changes to e.g the type or template etc. are.

Each clone is created by first collecting the above mentioned settings and then creating a new instance with the normal constructor function. As a result, any side effects of mutator methods (setProperty etc.) or init hooks are repeated during clone creation. There is no need to override clone() just to reproduce these internal settings!

Custom controls however can override clone() to implement additional clone steps. They usually will first call clone() on the super class and then modify the returned clone accordingly.

Applications must never provide the second parameter aLocaleIds. It is determined automatically for the root object (and its non-existence also serves as an indicator for the root object). Specifying it will break the implementation of clone().

Parameters:
stringsIdSuffix?a suffix to be appended to the cloned object ID
string[]aLocalIds?an array of local IDs within the cloned hierarchy (internally used)
ObjectoOptions?configuration object
booleancloneChildren?, Default: trueWhether associations and aggregations will be cloned
booleancloneBindings?, Default: trueWhether bindings will be cloned
Returns:
sap.ui.base.ManagedObjectReference to the newly created clone
destroy(bSuppressInvalidate?)

Cleans up the resources associated with this object and all its aggregated children.

After an object has been destroyed, it can no longer be used in!

Applications should call this method if they don't need the object any longer.

Parameters:
booleanbSuppressInvalidate?if true, this ManagedObject is not marked as changed
destroyAggregation(sAggregationName, bSuppressInvalidate?): sap.ui.base.ManagedObject

Destroys (all) the managed object(s) in the aggregation named sAggregationName and empties the aggregation. If the aggregation did contain any object, this ManagedObject is marked as changed.

Note: This method is a low-level API as described in the class documentation. Applications or frameworks must not use this method to generically destroy all objects in an aggregation. Use the concrete method destroyXYZ for aggregation 'XYZ' instead.

Parameters:
stringsAggregationNamethe name of the aggregation
booleanbSuppressInvalidate?if true, this ManagedObject is not marked as changed
Returns:
sap.ui.base.ManagedObjectReturns this to allow method chaining
detachFormatError(fnFunction, oListener): sap.ui.base.ManagedObject

Detaches event handler fnFunction from the formatError event of this sap.ui.base.ManagedObject.

The passed function and listener object must match the ones used for event registration.

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.ui.base.ManagedObjectReference to this in order to allow method chaining
detachModelContextChange(fnFunction, oListener): sap.ui.base.ManagedObject

Detaches event handler fnFunction from the modelContextChange event of this sap.ui.base.ManagedObject.

The passed function and listener object must match the ones used for event registration.

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.ui.base.ManagedObjectReference to this in order to allow method chaining
detachParseError(fnFunction, oListener): sap.ui.base.ManagedObject

Detaches event handler fnFunction from the parseError event of this sap.ui.base.ManagedObject.

The passed function and listener object must match the ones used for event registration.

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.ui.base.ManagedObjectReference to this in order to allow method chaining
detachValidationError(fnFunction, oListener): sap.ui.base.ManagedObject

Detaches event handler fnFunction from the validationError event of this sap.ui.base.ManagedObject.

The passed function and listener object must match the ones used for event registration.

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.ui.base.ManagedObjectReference to this in order to allow method chaining
detachValidationSuccess(fnFunction, oListener): sap.ui.base.ManagedObject

Detaches event handler fnFunction from the validationSuccess event of this sap.ui.base.ManagedObject.

The passed function and listener object must match the ones used for event registration.

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.ui.base.ManagedObjectReference to this in order to allow method chaining
findAggregatedObjects(bRecursive, fnCondition?): sap.ui.base.ManagedObject[]

Searches and returns all aggregated objects that pass the given check function.

When the search is done recursively (bRecursive === true), it will be executed depth-first and ancestors will be added to the result array before their descendants.

If no check function is given, all aggregated objects will pass the check and be added to the result array.

Take care: this operation might be expensive.

Parameters:
booleanbRecursiveWhether the whole aggregation tree should be searched
booleanfnCondition?Objects for which this function returns a falsy value will not be added to the result array
Returns:
sap.ui.base.ManagedObject[]Array of aggregated objects that passed the check
fireFormatError(mParameters?): sap.ui.base.ManagedObject
Fires event formatError to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
sap.ui.base.ManagedObjectmParameters.element?ManagedObject instance whose property should have received the model update.
stringmParameters.property?Name of the property for which the binding should have been updated.
sap.ui.model.TypemParameters.type?Data type used in the binding (if any).
anymParameters.newValue?New value (model representation) as propagated from the model.
anymParameters.oldValue?Old value (external representation) as previously stored in the ManagedObject.
Returns:
sap.ui.base.ManagedObjectReference to this in order to allow method chaining
fireModelContextChange(mParameters?): sap.ui.base.ManagedObject
Fires event modelContextChange to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
Returns:
sap.ui.base.ManagedObjectReference to this in order to allow method chaining
fireParseError(mParameters?): sap.ui.base.ManagedObject
Fires event parseError to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
sap.ui.base.ManagedObjectmParameters.element?ManagedObject instance whose property initiated the model update.
stringmParameters.property?Name of the property for which the bound model property should have been been updated.
sap.ui.model.TypemParameters.type?Data type used in the binding.
anymParameters.newValue?New value (external representation) as parsed by the binding.
anymParameters.oldValue?Old value (external representation) as previously stored in the ManagedObject.
stringmParameters.message?Localized message describing the parse error
Returns:
sap.ui.base.ManagedObjectReference to this in order to allow method chaining
fireValidationError(mParameters?): sap.ui.base.ManagedObject
Fires event validationError to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
sap.ui.base.ManagedObjectmParameters.element?ManagedObject instance whose property initiated the model update.
stringmParameters.property?Name of the property for which the bound model property should have been been updated.
sap.ui.model.TypemParameters.type?Data type used in the binding.
anymParameters.newValue?New value (external representation) as parsed and validated by the binding.
anymParameters.oldValue?Old value (external representation) as previously stored in the ManagedObject.
stringmParameters.message?Localized message describing the validation issues
Returns:
sap.ui.base.ManagedObjectReference to this in order to allow method chaining
fireValidationSuccess(mParameters?): sap.ui.base.ManagedObject
Fires event validationSuccess to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
sap.ui.base.ManagedObjectmParameters.element?ManagedObject instance whose property initiated the model update.
stringmParameters.property?Name of the property for which the bound model property has been updated.
sap.ui.model.TypemParameters.type?Data type used in the binding.
anymParameters.newValue?

New value (external representation) as propagated to the model.

Note: the model might modify (normalize) the value again and this modification will be stored in the ManagedObject. The 'newValue' parameter of this event contains the value before such a normalization.

anymParameters.oldValue?Old value (external representation) as previously stored in the ManagedObject.
Returns:
sap.ui.base.ManagedObjectReference to this in order to allow method chaining
getAggregation(sAggregationName, oDefaultForCreation)

Returns the aggregated object(s) for the named aggregation of this ManagedObject.

If the aggregation does not contain any objects(s), the given oDefaultForCreation (or null) is set as new value of the aggregation and returned to the caller.

Note: the need to specify a default value and the fact that it is stored as new value of a so far empty aggregation is recognized as a shortcoming of this API but can no longer be changed for compatibility reasons.

Note: This method is a low-level API as described in the class documentation. Applications or frameworks must not use this method to generically read the content of an aggregation. Use the concrete method getXYZ for aggregation 'XYZ' instead.

Parameters:
stringsAggregationNamethe name of the aggregation
sap.ui.base.ManagedObject|ArrayoDefaultForCreationthe object that is used in case the current aggregation is empty
getAssociation(sAssociationName, oDefaultForCreation): string|string[]

Returns the content of the association with the given name.

For associations of cardinality 0..1, a single string with the ID of an associated object is returned (if any). For cardinality 0..n, an array with the IDs of the associated objects is returned.

If the association does not contain any objects(s), the given oDefaultForCreation is set as new value of the association and returned to the caller. The only supported values for oDefaultForCreation are null and undefined in the case of cardinality 0..1 and null, undefined or an empty array ([]) in case of cardinality 0..n. If the argument is omitted, null is used independently from the cardinality.

Note: the need to specify a default value and the fact that it is stored as new value of a so far empty association is recognized as a shortcoming of this API but can no longer be changed for compatibility reasons.

Note: This method is a low-level API as described in the class documentation. Applications or frameworks must not use this method to generically retrieve the content of an association. Use the concrete method getXYZ for association 'XYZ' instead.

Parameters:
stringsAssociationNamethe name of the association
objectoDefaultForCreationthe object that is used in case the current aggregation is empty (only null or empty array allowed)
Returns:
string|string[]the ID of the associated managed object or an array of such IDs; may be null if the association has not been populated
getBinding(sName): sap.ui.model.Binding
Get the binding object for a specific aggregation/property
Parameters:
stringsNamethe name of the property or aggregation
Returns:
sap.ui.model.Bindingthe binding for the given name
getBindingContext(sModelName?): sap.ui.model.Context

Get the binding context of this object for the given model name.

If the object does not have a binding context set on itself and has no own model set, it will use the first binding context defined in its parent hierarchy.

Note: to be compatible with future versions of this API, applications must not use the value null, the empty string "" or the string literals "null" or "undefined" as model name.

Note: A ManagedObject inherits binding contexts from the Core only when it is a descendant of a UIArea.

Parameters:
stringsModelName?the name of the model or undefined
Returns:
sap.ui.model.ContextThe binding context of this object
getBindingInfo(sName): object
Returns the binding infos for the given property or aggregation. The binding info contains information about path, binding object, format options, sorter, filter etc. for the property or aggregation. As the binding object is only created when the model becomes available, the binding property may be undefined.
Parameters:
stringsNamethe name of the property or aggregation
Returns:
objectthe binding info object, containing at least a path or parts property and, depending on the binding type, additional properties
getBindingPath(sName): string
Get the binding path for a specific aggregation/property
Parameters:
stringsNamethe name of the property or aggregation
Returns:
stringthe binding path for the given name
getEventingParent(): sap.ui.base.EventProvider
Returns the parent managed object as new eventing parent to enable control event bubbling or null if this object hasn't been added to a parent yet.
Returns:
sap.ui.base.EventProviderthe parent event provider
getId(): string
Returns the object's Id.
Returns:
stringthe objects's Id.
Returns the metadata for the class that this object belongs to.
Returns:
sap.ui.base.ManagedObjectMetadataMetadata for the class of the object
getModel(sName?): sap.ui.model.Model

Get the model to be used for data bindings with the given model name. If the object does not have a model set on itself, it will use the first model defined in its parent hierarchy.

The name can be omitted to reference the default model or it must be a non-empty string.

Note: to be compatible with future versions of this API, applications must not use the value null, the empty string "" or the string literals "null" or "undefined" as model name.

Parameters:
string|undefinedsName?name of the model to be retrieved
Returns:
sap.ui.model.ModeloModel
getObjectBinding(sModelName): sap.ui.model.Binding
Get the object binding object for a specific model
Parameters:
stringsModelNamethe name of the model
Returns:
sap.ui.model.Bindingthe element binding for the given model name
getOriginInfo(sPropertyName): object

Returns the origin info for the value of the given property.

The origin info might contain additional information for translatable texts. The bookkeeping of this information is not active by default and must be activated by configuration. Even then, it might not be present for all properties and their values depending on where the value came form.

Parameters:
stringsPropertyNamethe name of the property
Returns:
objecta map of properties describing the origin of this property value or null

Returns the parent managed object or null if this object hasn't been added to a parent yet.

The parent returned by this method is the technical parent used for data binding, invalidation, rendering etc. It might differ from the object on which the application originally added this object (the so called 'API parent'): some composite controls internally use hidden controls or containers to store their children. This method will return the innermost container that technically contains this object as a child.

Example:

Assume that a Dialog internally uses a (hidden) VerticalLayout to store its content:

  Dialog (API parent)
   \__ VerticalLayout (hidden composite part)
      \__ Text (API child)

If you add some content by calling the Dialog.prototype.addContent API, this will lead to the following observations:

  oDialog.addContent(oText);
  console.log(oText.getParent() === oDialog);  // false
  console.log(oText.getParent() instanceof VerticalLayout); // true
  console.log(oText.getParent().getParent() === oDialog); // true now, but might fail with later versions

Technically, from API perspective, oText is added as a child to Dialog. But internally, the Dialog adds the child to the hidden VerticalLayout container. If you now call the getParent method of the child, you will get the internal VerticalLayout object and not the Dialog API parent.

Note: The internal (hidden) structure of a composite control is not fixed and may be changed (see also our "Compatibility Rules"). Therefore, you should never rely on a specific structure or object being returned by getParent.

Note: There is no API to determine the original API parent.

Returns:
sap.ui.base.ManagedObjectThe technical parent managed object or null
getProperty(sPropertyName): any

Returns the value for the property with the given sPropertyName.

Note: This method is a low-level API as described in the class documentation. Applications or frameworks must not use this method to generically retrieve the value of a property. Use the concrete method getXYZ for property 'XYZ' instead.

Parameters:
stringsPropertyNamethe name of the property
Returns:
anythe value of the property
hasModel(): boolean

Check if any model is set to the ManagedObject or to one of its parents (including UIArea and Core).

Note: A ManagedObject inherits models from the Core only when it is a descendant of a UIArea.

Returns:
booleanwhether a model reference exists or not
indexOfAggregation(sAggregationName, oObject): int

Searches for the provided ManagedObject in the named aggregation and returns its 0-based index if found, or -1 otherwise. Returns -2 if the given named aggregation is of cardinality 0..1 and doesn't reference the given object.

Note: This method is a low-level API as described in the class documentation. Applications or frameworks must not use this method to generically determine the position of an object in an aggregation. Use the concrete method indexOfXYZ for aggregation 'XYZ' instead.

Parameters:
stringsAggregationNamethe name of the aggregation
sap.ui.base.ManagedObjectoObjectthe ManagedObject whose index is looked for.
Returns:
intthe index of the provided managed object in the aggregation.
insertAggregation(sAggregationName, oObject, iIndex, bSuppressInvalidate?): sap.ui.base.ManagedObject

Inserts managed object oObject to the aggregation named sAggregationName at position iIndex.

If the given object is not valid with regard to the aggregation (if it is not an instance of the type specified for that aggregation) or when the method is called for an aggregation of cardinality 0..1, then an Error is thrown (see validateAggregation.

If the given index is out of range with respect to the current content of the aggregation, it is clipped to that range (0 for iIndex < 0, n for iIndex > n).

Please note that this method does not work as expected when an object is added that is already part of the aggregation. In order to change the index of an object inside an aggregation, first remove it, then insert it again.

Note: This method is a low-level API as described in the class documentation. Applications or frameworks must not use this method to generically insert an object into an aggregation. Use the concrete method insertXYZ for aggregation 'XYZ' instead.

Parameters:
stringsAggregationNamethe string identifying the aggregation the managed object oObject should be inserted into.
sap.ui.base.ManagedObjectoObjectthe ManagedObject to add; if empty, nothing is inserted.
intiIndexthe 0-based index the managed object should be inserted at; for a negative value iIndex, oObject is inserted at position 0; for a value greater than the current size of the aggregation, oObject is inserted at the last position
booleanbSuppressInvalidate?if true, this ManagedObject as well as the added child are not marked as changed
Returns:
sap.ui.base.ManagedObjectReturns this to allow method chaining
invalidate()
This triggers rerendering of itself and its children.
As sap.ui.base.ManagedObject "bubbles up" the invalidate, changes to child-Elements will also result in rerendering of the whole sub tree.
isBound(sName): boolean
Find out whether a property or aggregation is bound
Parameters:
stringsNamethe name of the property or aggregation
Returns:
booleanwhether a binding exists for the given name
isInvalidateSuppressed()
Returns whether rerendering is currently suppressed on this ManagedObject
isPropertyInitial(sPropertyName): boolean
Returns whether the given property value is initial and has not been explicitly set or bound. Even after setting the default value or setting null/undefined (which also causes the default value to be set), the property is no longer initial. A property can be reset to initial state by calling resetProperty(sPropertyName).
Parameters:
stringsPropertyNamethe name of the property
Returns:
booleantrue if the property is initial
isTreeBinding(sName): boolean
This method is used internally and should only be overridden by a tree managed object which utilizes the tree binding. In this case and if the aggregation is a tree node the overridden method should then return true. If true is returned the tree binding will be used instead of the list binding.
Parameters:
stringsNamethe aggregation to bind (e.g. nodes for a tree managed object)
Returns:
booleanwhether tree binding should be used or list binding. Default is false. Override method to change this behavior.
propagateMessages(sName, aMessages)
Generic method which is called, whenever messages for this object exists.
Parameters:
stringsNameThe property name
arrayaMessagesThe messages
Since:
1.28
refreshAggregation(sName)

Generic method which can be called, when an aggregation needs to be refreshed. This method does not make any change on the aggregation, but just calls the getContexts method of the binding to trigger fetching of new data.

Subclasses should call this method only in the implementation of a named refresh method and for no other purposes. The framework might change the conditions under which the method is called and the method implementation might rely on those conditions.

Parameters:
stringsNamename of the aggregation to refresh
removeAggregation(sAggregationName, vObject, bSuppressInvalidate?): sap.ui.base.ManagedObject

Removes an object from the aggregation named sAggregationName with cardinality 0..n.

The removed object is not destroyed nor is it marked as changed.

If the given object is found in the aggregation, it is removed, it's parent relationship is unset and this ManagedObject is marked as changed. The removed object is returned as result of this method. If the object could not be found, undefined is returned.

This method must only be called for aggregations of cardinality 0..n. The only way to remove objects from a 0..1 aggregation is to set a null value for them.

Note: This method is a low-level API as described in the class documentation. Applications or frameworks must not use this method to generically remove an object from an aggregation. Use the concrete method removeXYZ for aggregation 'XYZ' instead.

Parameters:
stringsAggregationNamethe string identifying the aggregation that the given object should be removed from
int|string|sap.ui.base.ManagedObjectvObjectthe position or ID of the ManagedObject that should be removed or that ManagedObject itself; if vObject is invalid, a negative value or a value greater or equal than the current size of the aggregation, nothing is removed.
booleanbSuppressInvalidate?if true, this ManagedObject is not marked as changed
Returns:
sap.ui.base.ManagedObjectthe removed object or null
removeAllAggregation(sAggregationName, bSuppressInvalidate?)

Removes all objects from the 0..n-aggregation named sAggregationName.

The removed objects are not destroyed nor are they marked as changed.

Additionally, it clears the parent relationship of all removed objects, marks this ManagedObject as changed and returns an array with the removed objects.

If the aggregation did not contain any objects, an empty array is returned and this ManagedObject is not marked as changed.

Note: This method is a low-level API as described in the class documentation. Applications or frameworks must not use this method to generically remove all objects from an aggregation. Use the concrete method removeAllXYZ for aggregation 'XYZ' instead.

Parameters:
stringsAggregationNamethe name of the aggregation
booleanbSuppressInvalidate?if true, this ManagedObject is not marked as changed
removeAllAssociation(sAssociationName, bSuppressInvalidate?)

Removes all the objects in the 0..n-association named sAssociationName and returns an array with their IDs. This ManagedObject is marked as changed, if the association contained any objects.

Note: This method is a low-level API as described in the class documentation. Applications or frameworks must not use this method to generically remove all object from an association. Use the concrete method removeAllXYZ for association 'XYZ' instead.

Parameters:
stringsAssociationNamethe name of the association
booleanbSuppressInvalidate?if true, this ManagedObject is not marked as changed
removeAssociation(sAssociationName, vObject, bSuppressInvalidate?): string|null

Removes a ManagedObject from the association named sAssociationName.

If an object is removed, the ID of that object is returned and this ManagedObject is marked as changed. Otherwise null is returned.

If the same object was added multiple times to the same association, only a single occurrence of it will be removed by this method. If the object is not found or if the parameter can't be interpreted neither as a ManagedObject (or ID) nor as an index in the association, nothing will be removed. The same is true if an index is given and if that index is out of range for the association.

Note: This method is a low-level API as described in the class documentation. Applications or frameworks must not use this method to generically remove an object from an association. Use the concrete method removeXYZ for association 'XYZ' instead.

Parameters:
stringsAssociationNamethe string identifying the association the ManagedObject should be removed from.
int|string|sap.ui.base.ManagedObjectvObjectthe position or ID of the ManagedObject to remove or the ManagedObject itself; if vObject is invalid input, a negative value or a value greater or equal than the current size of the association, nothing is removed
booleanbSuppressInvalidate?if true, the managed object is not marked as changed
Returns:
string|nullID of the removed ManagedObject or null
resetProperty(sPropertyName): sap.ui.base.ManagedObject
Resets the given property to the default value and also restores the "initial" state (like it has never been set).
Parameters:
stringsPropertyNamethe name of the property
Returns:
sap.ui.base.ManagedObjectReturns this to allow method chaining
setAggregation(sAggregationName, oObject, bSuppressInvalidate?): sap.ui.base.ManagedObject

Sets a new object in the named 0..1 aggregation of this ManagedObject and marks this ManagedObject as changed.

If the given object is not valid with regard to the aggregation (if it is not an instance of the type specified for that aggregation) or when the method is called for an aggregation of cardinality 0..n, then an Error is thrown (see validateAggregation.

If the new object is the same as the currently aggregated object, then the internal state is not modified and this ManagedObject is not marked as changed.

If the given object is different, the parent of a previously aggregated object is cleared (it must have been this ManagedObject before), the parent of the given object is set to this ManagedObject and invalidate is called for this object.

Note that this method does neither return nor destroy the previously aggregated object. This behavior is inherited by named set methods (see below) in subclasses. To avoid memory leaks, applications therefore should first get the aggregated object, keep a reference to it or destroy it, depending on their needs, and only then set a new object.

Note that ManagedObject only implements a single level of change tracking: if a first call to setAggregation recognizes a change, 'invalidate' is called. If another call to setAggregation reverts that change, invalidate() will be called again, the new status is not recognized as being 'clean' again.

Note: This method is a low-level API as described in the class documentation. Applications or frameworks must not use this method to generically set an object in an aggregation. Use the concrete method setXYZ for aggregation 'XYZ' or the generic applySettings instead.

Parameters:
stringsAggregationNamename of an 0..1 aggregation
objectoObjectthe managed object that is set as aggregated object
booleanbSuppressInvalidate?if true, this ManagedObject is not marked as changed
Returns:
sap.ui.base.ManagedObjectReturns this to allow method chaining
Throws:
Error
setAssociation(sAssociationName, sId, bSuppressInvalidate?): sap.ui.base.ManagedObject

Sets the associated object for the given managed association of cardinality '0..1' and marks this ManagedObject as changed.

The associated object can either be given by itself or by its id. If null or undefined is given, the association is cleared.

Note: This method is a low-level API as described in the class documentation. Applications or frameworks must not use this method to generically set an object in an association. Use the concrete method setXYZ for association 'XYZ' or the generic applySettings instead.

Parameters:
stringsAssociationNamename of the association
string|sap.ui.base.ManagedObjectsIdthe ID of the managed object that is set as an association, or the managed object itself or null
booleanbSuppressInvalidate?if true, the managed objects invalidate method is not called
Returns:
sap.ui.base.ManagedObjectReturns this to allow method chaining
setBindingContext(oContext, sModelName?): sap.ui.base.ManagedObject

Set the binding context for this ManagedObject for the model with the given name.

Note: to be compatible with future versions of this API, applications must not use the value null, the empty string "" or the string literals "null" or "undefined" as model name.

Note: A ManagedObject inherits binding contexts from the Core only when it is a descendant of a UIArea.

Parameters:
sap.ui.model.ContextoContextthe new binding context for this object
stringsModelName?the name of the model to set the context for or undefined
Returns:
sap.ui.base.ManagedObjectreference to the instance itself
setModel(oModel, sName?): sap.ui.base.ManagedObject

Sets or unsets a model for the given model name for this ManagedObject.

The sName must either be undefined (or omitted) or a non-empty string. When the name is omitted, the default model is set/unset.

When oModel is null or undefined, a previously set model with that name is removed from this ManagedObject. If an ancestor (parent, UIArea or Core) has a model with that name, this ManagedObject will immediately inherit that model from its ancestor.

All local bindings that depend on the given model name are updated (created if the model references became complete now; updated, if any model reference has changed; removed if the model references became incomplete now).

Any change (new model, removed model, inherited model) is also applied to all aggregated descendants as long as a descendant doesn't have its own model set for the given name.

Note: to be compatible with future versions of this API, applications must not use the value null, the empty string "" or the string literals "null" or "undefined" as model name.

Note: By design, it is not possible to hide an inherited model by setting a null or undefined model. Applications can set an empty model to achieve the same.

Note: A ManagedObject inherits models from the Core only when it is a descendant of a UIArea.

Parameters:
sap.ui.model.ModeloModelthe model to be set or null or undefined
stringsName?the name of the model or undefined
Returns:
sap.ui.base.ManagedObjectthis to allow method chaining
setProperty(sPropertyName, oValue, bSuppressInvalidate?): sap.ui.base.ManagedObject

Sets the given value for the given property after validating and normalizing it, marks this object as changed.

If the value is not valid with regard to the declared data type of the property, an Error is thrown. In case null or undefined is passed, the default value for this property is used (see validateProperty). To fully reset the property to initial state, use resetProperty instead. If the validated and normalized oValue equals the current value of the property, the internal state of this object is not changed (apart from the result of isPropertyInitial). If the value changes, it is stored internally and the invalidate method is called on this object. In the case of TwoWay databinding, the bound model is informed about the property change.

Note that ManagedObject only implements a single level of change tracking: if a first call to setProperty recognizes a change, 'invalidate' is called. If another call to setProperty reverts that change, invalidate() will be called again, the new status is not recognized as being 'clean' again.

Note: This method is a low level API as described in the class documentation. Applications or frameworks must not use this method to generically set a property. Use the concrete method setXYZ for property 'XYZ' or the generic applySettings instead.

Parameters:
stringsPropertyNamename of the property to set
anyoValuevalue to set the property to
booleanbSuppressInvalidate?if true, the managed object is not marked as changed
Returns:
sap.ui.base.ManagedObjectReturns this to allow method chaining
toString(): string

Returns a simple string representation of this managed object.

Mainly useful for tracing purposes.

Returns:
stringa string description of this managed object
unbindAggregation(sName, bSuppressReset): sap.ui.base.ManagedObject
Unbind the aggregation from the model
Parameters:
stringsNamethe name of the aggregation
booleanbSuppressResetwhether the reset to empty aggregation when unbinding should be suppressed
Returns:
sap.ui.base.ManagedObjectreference to the instance itself
unbindObject(sModelName?): sap.ui.base.ManagedObject
Removes the defined binding context of this object, all bindings will now resolve relative to the parent context again.
Parameters:
stringsModelName?name of the model to remove the context for.
Returns:
sap.ui.base.ManagedObjectreference to the instance itself
unbindProperty(sName, bSuppressReset): sap.ui.base.ManagedObject
Unbind the property from the model
Parameters:
stringsNamethe name of the property
booleanbSuppressResetwhether the reset to the default value when unbinding should be suppressed
Returns:
sap.ui.base.ManagedObjectreference to the instance itself
updateAggregation(sName)

Generic method which is called whenever an aggregation binding has changed.

Depending on the type of the list binding and on additional configuration, this method either destroys all elements in the aggregation sName and recreates them anew or tries to reuse as many existing objects as possible. It is up to the method which strategy it uses.

In case a managed object needs special handling for an aggregation binding, it can create a named update method (e.g. updateRows for an aggregation rows) which then will be called by the framework instead of this generic method.

Subclasses should call this method only in the implementation of such a named update method and for no other purposes. The framework might change the conditions under which the method is called and the method implementation might rely on those conditions.

Parameters:
stringsNamename of the aggregation to update
validateAggregation(sAggregationName, oObject, bMultiple): sap.ui.base.ManagedObject|any

Checks whether the given value is of the proper type for the given aggregation name.

This method is already called by setAggregation, addAggregation and insertAggregation. In many cases, subclasses of ManagedObject don't need to call it again in their mutator methods.

Parameters:
stringsAggregationNamethe name of the aggregation
sap.ui.base.ManagedObject|anyoObjectthe aggregated object or a primitive value
booleanbMultiplewhether the caller assumes the aggregation to have cardinality 0..n
Returns:
sap.ui.base.ManagedObject|anythe passed object
Throws:
Error if no aggregation with the given name is found or the given value does not fit to the aggregation type
validateProperty(sPropertyName, oValue): any

Checks whether the given value is of the proper type for the given property name.

In case null or undefined is passed, the default value for this property is used as value. If no default value is defined for the property, the default value of the type of the property is used.

If the property has a data type that is an instance of sap.ui.base.DataType and if a normalize function is defined for that type, that function will be called with the resulting value as only argument. The result of the function call is then used instead of the raw value.

This method is called by setProperty. In many cases, subclasses of ManagedObject don't need to call it themselves.

Parameters:
stringsPropertyNamethe name of the property
anyoValuethe value
Returns:
anythe normalized value for the passed value or for the default value if null or undefined was passed
Throws:
Error if no property with the given name is found or the given value does not fit to the property type
bindContext(sPath): sap.ui.base.ManagedObject
Bind the object to the referenced entity in the model, which is used as the binding context to resolve bound properties or aggregations of the object itself and all of its children relatively to the given path.
Parameters:
stringsPaththe binding path
Returns:
sap.ui.base.ManagedObjectreference to the instance itself
Deprecated API:
Since 1.11.1, please use bindElement instead.
unbindContext(sModelName?): sap.ui.base.ManagedObject
Removes the defined binding context of this object, all bindings will now resolve relative to the parent context again.
Parameters:
stringsModelName?name of the model to remove the context for.
Returns:
sap.ui.base.ManagedObjectreference to the instance itself
Deprecated API:
Since 1.11.1, please use unbindElement instead.