An area in a page that hosts a tree of UI elements.
UIArea
s 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.
UIArea
s 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, UIArea
s 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.
UIArea
s 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.
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. |
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: 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 |
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
|
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 |
sap.ui.core.UIArea.getMetadata |
Returns a metadata object for class sap.ui.core.UIArea. |
getRootControl |
Returns the content control of this
Since 1.1 use function {@link #getContent} instead
|
getRootNode |
Returns the Root Node hosting this instance of |
getUIArea |
Returns this UI area. Needed to stop recursive calls from an element to its parent. |
indexOfContent |
Checks for the provided |
indexOfDependent |
Checks for the provided |
insertContent |
Inserts a content into the aggregation content. |
insertDependent |
Inserts a dependent into the aggregation dependents. |
invalidate |
Triggers asynchronous re-rendering of the 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 |
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 The node must have an ID that will be used as ID for this instance of |
unlock |
Un-Locks this instance of UIArea. Rerendering and eventing will now be enabled again. |
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 |
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 |
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 |
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 |
Gets content of aggregation dependents.
Dependent objects whose lifecycle is bound to the UIArea but which are not automatically rendered by the UIArea.
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.
Returns the content control of this UIArea
at the specified index. If no index is given the first content control is returned.
Param | Type | DefaultValue | Description |
---|---|---|---|
idx | int |
index of the control in the content of this |
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 |
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 |
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 |
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 |
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.
Locks this instance of UIArea.
Rerendering and eventing will not be active as long as no #unlock is called.
Removes all the controls from the aggregation content.
Additionally, it unregisters them from the hosting UIArea.
Removes all the controls from the aggregation dependents.
Additionally, it unregisters them from the hosting UIArea.
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 |
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 |
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().
Param | Type | DefaultValue | Description |
---|---|---|---|
oRootControl | sap.ui.base.Interface sap.ui.core.Control |
the Control that should be the Root for this |