Class sap.ui.core.ComponentContainerModule: sap/ui/core/ComponentContainer

extends Control

Component Container
Constructor Summary
new sap.ui.core.ComponentContainer(sId?, mSettings?)Constructor for a new ComponentContainer.
Event Summary
componentCreated(oControlEvent)Fired when the component instance has been created by the ComponentContainer.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.core.ComponentContainer.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.core.ComponentContainer with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.core.ComponentContainer.getMetadata()Returns a metadata object for class sap.ui.core.ComponentContainer.
attachComponentCreated(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the componentCreated event of this sap.ui.core.ComponentContainer.
detachComponentCreated(fnFunction, oListener)Detaches event handler fnFunction from the componentCreated event of this sap.ui.core.ComponentContainer.
fireComponentCreated(mParameters?)Fires event componentCreated to attached listeners.
getAsync()Gets current value of property async.
getAutoPrefixId()Gets current value of property autoPrefixId.
getComponent()ID of the element which is the current target of the association component, or null.
getHandleValidation()Gets current value of property handleValidation.
getHeight()Gets current value of property height.
getLifecycle()Gets current value of property lifecycle.
getName()Gets current value of property name.
getPropagateModel()Gets current value of property propagateModel.
getSettings()Gets current value of property settings.
getUrl()Gets current value of property url.
getUsage()Gets current value of property usage.
getWidth()Gets current value of property width.
setAsync(bAsync)Sets a new value for property async.
setAutoPrefixId(bAutoPrefixId)Sets a new value for property autoPrefixId.
setComponent(vComponent)Sets the component of the container.
setHandleValidation(bHandleValidation)Sets a new value for property handleValidation.
setHeight(sHeight)Sets a new value for property height.
setLifecycle(sLifecycle)Sets a new value for property lifecycle.
setName(sName)Sets a new value for property name.
setPropagateModel(bPropagateModel)Sets a new value for property propagateModel.
setSettings(oSettings)Sets a new value for property settings.
setUrl(sUrl)Sets a new value for property url.
setUsage(sUsage)Sets a new value for property usage.
setWidth(sWidth)Sets a new value for property width.
Constructor Detail
new sap.ui.core.ComponentContainer(sId?, mSettings?)

Constructor for a new ComponentContainer.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.

The supported settings are:

In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.

Parameters:
stringsId?id for the new control, generated automatically if no id is given
objectmSettings?initial settings for the new control
Event Detail
componentCreated(oControlEvent)
Fired when the component instance has been created by the ComponentContainer.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
Since:
1.50
Method Detail
sap.ui.core.ComponentContainer.extend(sClassName, oClassInfo?, FNMetaImpl?): function

Creates a new subclass of class sap.ui.core.ComponentContainer with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

Parameters:
stringsClassNameName of the class being created
objectoClassInfo?Object literal with information about the class
functionFNMetaImpl?Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
functionCreated class / constructor function
sap.ui.core.ComponentContainer.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.core.ComponentContainer.
Returns:
sap.ui.base.MetadataMetadata object describing this class
attachComponentCreated(oData?, fnFunction, oListener?): sap.ui.core.ComponentContainer

Attaches event handler fnFunction to the componentCreated event of this sap.ui.core.ComponentContainer.

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.core.ComponentContainer itself.

Fired when the component instance has been created by the ComponentContainer.

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.core.ComponentContainer itself
Returns:
sap.ui.core.ComponentContainerReference to this in order to allow method chaining
Since:
1.50
detachComponentCreated(fnFunction, oListener): sap.ui.core.ComponentContainer

Detaches event handler fnFunction from the componentCreated event of this sap.ui.core.ComponentContainer.

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.core.ComponentContainerReference to this in order to allow method chaining
Since:
1.50
fireComponentCreated(mParameters?): sap.ui.core.ComponentContainer
Fires event componentCreated to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
Returns:
sap.ui.core.ComponentContainerReference to this in order to allow method chaining
Since:
1.50
getAsync(): boolean

Gets current value of property async.

Flag whether the component should be created sync (default) or async. This property can only be applied initially.

Default value is false.

Returns:
booleanValue of property async
getAutoPrefixId(): boolean

Gets current value of property autoPrefixId.

Flag, whether to autoprefix the id of the nested Component or not. If this property is set to true the ID of the Component will be prefixed with the ID of the ComponentContainer followed by a single dash. This property can only be applied initially.

Default value is false.

Returns:
booleanValue of property autoPrefixId
getComponent(): sap.ui.core.ID
ID of the element which is the current target of the association component, or null.
Returns:
sap.ui.core.ID
getHandleValidation(): boolean

Gets current value of property handleValidation.

Enable/disable validation handling by MessageManager for this component. The resulting Messages will be propagated to the controls. This property can only be applied initially.

Default value is false.

Returns:
booleanValue of property handleValidation
getHeight(): sap.ui.core.CSSSize

Gets current value of property height.

Container height in CSS size

Returns:
sap.ui.core.CSSSizeValue of property height

Gets current value of property lifecycle.

Lifecycle behavior for the Component associated by the ComponentContainer. The default behavior is Legacy. This means that the ComponentContainer takes care that the Component is destroyed when the ComponentContainer is destroyed, but it is not destroyed when a new Component is associated. If you use the usage property to create the Component, the default behavior is Container. This means that the Component is destroyed when the ComponentContainer is destroyed or a new Component is associated. This property must only be applied before a component instance is created.

Default value is Legacy.

Returns:
sap.ui.core.ComponentLifecycleValue of property lifecycle
getName(): string

Gets current value of property name.

Component name, the package where the component is contained. This property can only be applied initially.

Returns:
stringValue of property name
getPropagateModel(): boolean

Gets current value of property propagateModel.

Defines whether binding information is propagated to the component.

Default value is false.

Returns:
booleanValue of property propagateModel
getSettings(): object

Gets current value of property settings.

The settings object passed to the component when created. This property can only be applied initially.

Returns:
objectValue of property settings
getUrl(): sap.ui.core.URI

Gets current value of property url.

The URL of the component. This property can only be applied initially.

Returns:
sap.ui.core.URIValue of property url
getUsage(): string

Gets current value of property usage.

The component usage. If the ComponentContainer is used inside a Component, this Component can define a usage which will be used for creating the Component. This property can only be applied initially.

Returns:
stringValue of property usage
getWidth(): sap.ui.core.CSSSize

Gets current value of property width.

Container width in CSS size

Returns:
sap.ui.core.CSSSizeValue of property width

Sets a new value for property async.

Flag whether the component should be created sync (default) or async. This property can only be applied initially.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Parameters:
booleanbAsyncNew value for property async
Returns:
sap.ui.core.ComponentContainerReference to this in order to allow method chaining
setAutoPrefixId(bAutoPrefixId): sap.ui.core.ComponentContainer

Sets a new value for property autoPrefixId.

Flag, whether to autoprefix the id of the nested Component or not. If this property is set to true the ID of the Component will be prefixed with the ID of the ComponentContainer followed by a single dash. This property can only be applied initially.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Parameters:
booleanbAutoPrefixIdNew value for property autoPrefixId
Returns:
sap.ui.core.ComponentContainerReference to this in order to allow method chaining
setComponent(vComponent): sap.ui.core.ComponentContainer

Sets the component of the container. Depending on the ComponentContainer's lifecycle this might destroy the old associated Component.

Once the component is associated with the container the cross connection to the component will be set and the models will be propagated if defined. If the usage property is set the ComponentLifecycle is processed like a "Container" lifecycle.

Parameters:
string|sap.ui.core.UIComponentvComponentID of an element which becomes the new target of this component association. Alternatively, an element instance may be given.
Returns:
sap.ui.core.ComponentContainerthe reference to this in order to allow method chaining
setHandleValidation(bHandleValidation): sap.ui.core.ComponentContainer

Sets a new value for property handleValidation.

Enable/disable validation handling by MessageManager for this component. The resulting Messages will be propagated to the controls. This property can only be applied initially.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Parameters:
booleanbHandleValidationNew value for property handleValidation
Returns:
sap.ui.core.ComponentContainerReference to this in order to allow method chaining
setHeight(sHeight): sap.ui.core.ComponentContainer

Sets a new value for property height.

Container height in CSS size

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
sap.ui.core.CSSSizesHeightNew value for property height
Returns:
sap.ui.core.ComponentContainerReference to this in order to allow method chaining
setLifecycle(sLifecycle): sap.ui.core.ComponentContainer

Sets a new value for property lifecycle.

Lifecycle behavior for the Component associated by the ComponentContainer. The default behavior is Legacy. This means that the ComponentContainer takes care that the Component is destroyed when the ComponentContainer is destroyed, but it is not destroyed when a new Component is associated. If you use the usage property to create the Component, the default behavior is Container. This means that the Component is destroyed when the ComponentContainer is destroyed or a new Component is associated. This property must only be applied before a component instance is created.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is Legacy.

Parameters:
sap.ui.core.ComponentLifecyclesLifecycleNew value for property lifecycle
Returns:
sap.ui.core.ComponentContainerReference to this in order to allow method chaining

Sets a new value for property name.

Component name, the package where the component is contained. This property can only be applied initially.

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
stringsNameNew value for property name
Returns:
sap.ui.core.ComponentContainerReference to this in order to allow method chaining
setPropagateModel(bPropagateModel): sap.ui.core.ComponentContainer

Sets a new value for property propagateModel.

Defines whether binding information is propagated to the component.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Parameters:
booleanbPropagateModelNew value for property propagateModel
Returns:
sap.ui.core.ComponentContainerReference to this in order to allow method chaining
setSettings(oSettings): sap.ui.core.ComponentContainer

Sets a new value for property settings.

The settings object passed to the component when created. This property can only be applied initially.

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
objectoSettingsNew value for property settings
Returns:
sap.ui.core.ComponentContainerReference to this in order to allow method chaining

Sets a new value for property url.

The URL of the component. This property can only be applied initially.

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
sap.ui.core.URIsUrlNew value for property url
Returns:
sap.ui.core.ComponentContainerReference to this in order to allow method chaining

Sets a new value for property usage.

The component usage. If the ComponentContainer is used inside a Component, this Component can define a usage which will be used for creating the Component. This property can only be applied initially.

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
stringsUsageNew value for property usage
Returns:
sap.ui.core.ComponentContainerReference to this in order to allow method chaining

Sets a new value for property width.

Container width in CSS size

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
sap.ui.core.CSSSizesWidthNew value for property width
Returns:
sap.ui.core.ComponentContainerReference to this in order to allow method chaining