class sap.ui.core.UIArea

Control sample: sap.ui.core.UIArea
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/core/UIArea
Application Component: CA-UI5-COR

An area in a page that hosts a tree of UI elements.

UIAreas are fully managed by the UI5 Core. They cannot be created by the application but are implicitly created by the Core when controls are placed via Control#placeAt at a new DOM element for which no UIArea exists yet.

UIAreas are essential for the rendering of controls. Controls get rendered only when they are directly or indirectly contained in the content aggregation of a UIArea. Control#placeAt ensures that there is a UIArea with the given ID and adds the control to the content aggregation of this UIArea. Whenever controls become invalidated, the corresponding UIArea remembers this and takes care of the re-rendering of the control.

Additionally, UIAreas play an important role in the event handling of controls. They register for a standard set of browser events. For each incoming event, they identify the control to which the target of the event belongs to and dispatch the event to that control. This dispatching reduces the number of event handlers in a page.

UIAreas also act as a data binding root for their contained controls. Whenever a model is attached to or detached from the Core, this change is propagated to all UIAreas which in turn propagate it further down to their aggregated children, etc.

The special aggregation named dependents also participates in the databinding, but its content is not rendered by the UIArea. It can be used for popups or similar controls that are not contained in the normal control tree, but nevertheless should receive model or binding context updates.


Constructor


Aggregations

Default Aggregation:

Name Cardinality Type Description
content 0..n sap.ui.core.Control

Content that is displayed in the UIArea.

dependents 0..n sap.ui.core.Control

Dependent objects whose lifecycle is bound to the UIArea but which are not automatically rendered by the UIArea.


Methods Overview

Method Description
addContent

Adds some content to the aggregation content.

addDependent

Adds some dependent to the aggregation dependents.

sap.ui.core.UIArea.configureEventLogging

Enabled or disables logging of certain event types.

The event handling code of class UIArea logs all processed browser events with log level DEBUG. Only some events that occur too frequently are suppressed by default: mousemove, mouseover, mouseout, scroll, dragover, dragenter and dragleave.

With this method, logging can be disabled for further event types or it can be enabled for some or all of the event types listed above. The parameter mEventTypes is a map of boolean values keyed by event type names. When the value for an event type coerces to true, events of that type won't be logged.

destroyContent

Destroys all the content in the aggregation content.

destroyDependents

Destroys all the dependents in the aggregation dependents.

sap.ui.core.UIArea.extend

Creates a new subclass of class sap.ui.core.UIArea 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.base.ManagedObject.extend.

getBindingContext

Provide getBindingContext, as UIArea can be parent of an element.

getContent

Gets content of aggregation content.

Content that is displayed in the UIArea.

getDependents

Gets content of aggregation dependents.

Dependent objects whose lifecycle is bound to the UIArea but which are not automatically rendered by the UIArea.

getEventingParent

Returns the Core's event provider as new eventing parent to enable control event bubbling to the core to ensure compatibility with the core validation events.

getId

Returns this UIArea's id (as determined from provided RootNode).

sap.ui.core.UIArea.getMetadata

Returns a metadata object for class sap.ui.core.UIArea.

getRootControl

Returns the content control of this UIArea at the specified index. If no index is given the first content control is returned.

Since 1.1 use function {@link #getContent} instead
getRootNode

Returns the Root Node hosting this instance of UIArea.

getUIArea

Returns this UI area. Needed to stop recursive calls from an element to its parent.

indexOfContent

Checks for the provided sap.ui.core.Control in the aggregation content. and returns its index if found or -1 otherwise.

indexOfDependent

Checks for the provided sap.ui.core.Control in the aggregation dependents. and returns its index if found or -1 otherwise.

insertContent

Inserts a content into the aggregation content.

insertDependent

Inserts a dependent into the aggregation dependents.

invalidate

Triggers asynchronous re-rendering of the UIArea's content.

Serves as an end-point for the bubbling of invalidation requests along the element/control aggregation hierarchy.

isActive

Checks whether the control is still valid (is in the DOM)

isInvalidateSuppressed

Returns whether re-rendering is currently suppressed on this UIArea.

isLocked

Returns the locked state of the sap.ui.core.UIArea

lock

Locks this instance of UIArea.

Rerendering and eventing will not be active as long as no #unlock is called.

removeAllContent

Removes all the controls from the aggregation content.

Additionally, it unregisters them from the hosting UIArea.

removeAllDependents

Removes all the controls from the aggregation dependents.

Additionally, it unregisters them from the hosting UIArea.

removeContent

Removes a content from the aggregation content.

removeDependent

Removes a dependent from the aggregation dependents.

setRootControl

Sets the root control to be displayed in this UIArea.

First, all old content controls (if any) will be detached from this UIArea (e.g. their parent relationship to this UIArea will be cut off). Then the parent relationship for the new content control (if not empty) will be set to this UIArea and finally, the UIArea will be marked for re-rendering.

The real re-rendering happens whenever the re-rendering is called. Either implicitly at the end of any control event or by calling sap.ui.getCore().applyChanges().

Since 1.1 use {@link #removeAllContent} and {@link #addContent} instead
setRootNode

Allows setting the root node hosting this instance of UIArea.

The node must have an ID that will be used as ID for this instance of UIArea.

unlock

Un-Locks this instance of UIArea.

Rerendering and eventing will now be enabled again.

addContent

Adds some content to the aggregation content.

Param Type DefaultValue Description
oContent sap.ui.core.Control

The content to add; if empty, nothing is inserted

addDependent

Adds some dependent to the aggregation dependents.

Param Type DefaultValue Description
oDependent sap.ui.core.Control

The dependent to add; if empty, nothing is inserted

sap.ui.core.UIArea.configureEventLogging

Enabled or disables logging of certain event types.

The event handling code of class UIArea logs all processed browser events with log level DEBUG. Only some events that occur too frequently are suppressed by default: mousemove, mouseover, mouseout, scroll, dragover, dragenter and dragleave.

With this method, logging can be disabled for further event types or it can be enabled for some or all of the event types listed above. The parameter mEventTypes is a map of boolean values keyed by event type names. When the value for an event type coerces to true, events of that type won't be logged.

Param Type DefaultValue Description
mEventTypes object

Map of logging flags keyed by event types

destroyContent

Destroys all the content in the aggregation content.

destroyDependents

Destroys all the dependents in the aggregation dependents.

sap.ui.core.UIArea.extend

Creates a new subclass of class sap.ui.core.UIArea 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.base.ManagedObject.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

getBindingContext

Provide getBindingContext, as UIArea can be parent of an element.

getContent

Gets content of aggregation content.

Content that is displayed in the UIArea.

getDependents

Gets content of aggregation dependents.

Dependent objects whose lifecycle is bound to the UIArea but which are not automatically rendered by the UIArea.

getEventingParent

Returns the Core's event provider as new eventing parent to enable control event bubbling to the core to ensure compatibility with the core validation events.

getId

Returns this UIArea's id (as determined from provided RootNode).

sap.ui.core.UIArea.getMetadata

Returns a metadata object for class sap.ui.core.UIArea.

getRootControl

Returns the content control of this UIArea at the specified index. If no index is given the first content control is returned.

Since 1.1 use function {@link #getContent} instead
Param Type DefaultValue Description
idx int

index of the control in the content of this UIArea

getRootNode

Returns the Root Node hosting this instance of UIArea.

getUIArea

Returns this UI area. Needed to stop recursive calls from an element to its parent.

indexOfContent

Checks for the provided sap.ui.core.Control in the aggregation content. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oContent sap.ui.core.Control

The content whose index is looked for

indexOfDependent

Checks for the provided sap.ui.core.Control in the aggregation dependents. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oDependent sap.ui.core.Control

The dependent whose index is looked for

insertContent

Inserts a content into the aggregation content.

Param Type DefaultValue Description
oContent sap.ui.core.Control

The content to insert; if empty, nothing is inserted

iIndex int

The 0-based index the content should be inserted at; for a negative value of iIndex, the content is inserted at position 0; for a value greater than the current size of the aggregation, the content is inserted at the last position

insertDependent

Inserts a dependent into the aggregation dependents.

Param Type DefaultValue Description
oDependent sap.ui.core.Control

The dependent to insert; if empty, nothing is inserted

iIndex int

The 0-based index the dependent should be inserted at; for a negative value of iIndex, the dependent is inserted at position 0; for a value greater than the current size of the aggregation, the dependent is inserted at the last position

invalidate

Triggers asynchronous re-rendering of the UIArea's content.

Serves as an end-point for the bubbling of invalidation requests along the element/control aggregation hierarchy.

isActive

Checks whether the control is still valid (is in the DOM)

isInvalidateSuppressed

Returns whether re-rendering is currently suppressed on this UIArea.

isLocked

Returns the locked state of the sap.ui.core.UIArea

lock

Locks this instance of UIArea.

Rerendering and eventing will not be active as long as no #unlock is called.

removeAllContent

Removes all the controls from the aggregation content.

Additionally, it unregisters them from the hosting UIArea.

removeAllDependents

Removes all the controls from the aggregation dependents.

Additionally, it unregisters them from the hosting UIArea.

removeContent

Removes a content from the aggregation content.

Param Type DefaultValue Description
vContent int string sap.ui.core.Control

The content to remove or its index or id

removeDependent

Removes a dependent from the aggregation dependents.

Param Type DefaultValue Description
vDependent int string sap.ui.core.Control

The dependent to remove or its index or id

setRootControl

Sets the root control to be displayed in this UIArea.

First, all old content controls (if any) will be detached from this UIArea (e.g. their parent relationship to this UIArea will be cut off). Then the parent relationship for the new content control (if not empty) will be set to this UIArea and finally, the UIArea will be marked for re-rendering.

The real re-rendering happens whenever the re-rendering is called. Either implicitly at the end of any control event or by calling sap.ui.getCore().applyChanges().

Since 1.1 use {@link #removeAllContent} and {@link #addContent} instead
Param Type DefaultValue Description
oRootControl sap.ui.base.Interface sap.ui.core.Control

the Control that should be the Root for this UIArea.

setRootNode

Allows setting the root node hosting this instance of UIArea.

The node must have an ID that will be used as ID for this instance of UIArea.

Param Type DefaultValue Description
oRootNode object

the hosting DOM node for this instance of UIArea.

unlock

Un-Locks this instance of UIArea.

Rerendering and eventing will now be enabled again.