Class sap.uxap.BlockBaseModule: sap/uxap/BlockBase

extends Control

A block is the main element that will be displayed, mainly in an object page, but not necessarily only there.

A block is a control that use a XML view for storing its internal control tree. A block is a control that has modes and a view associated to each modes. At rendering time, the view associated to the mode is rendered.

Note: The control supports only XML views.

As any UI5 views, the XML view can have a controller which automatically comes a this.oParentBlock attribute (so that the controller can interacts with the block). If the controller implements the onParentBlockModeChange method, this method will get called with the sMode parameter when the view is used or re-used by the block.


Since: 1.26.
Constructor Summary
new sap.uxap.BlockBase(sId?, mSettings?)Constructor for a new BlockBase.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.uxap.BlockBase.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.uxap.BlockBase with name sClassName and enriches it with the information contained in oClassInfo.
sap.uxap.BlockBase.getMetadata()Returns a metadata object for class sap.uxap.BlockBase.
addMapping(oMapping)Adds some mapping to the aggregation mappings.
destroyMappings()Destroys all the mappings in the aggregation mappings.
getColumnLayout()Gets current value of property columnLayout.
getFormAdjustment()Gets current value of property formAdjustment.
getMappings()Gets content of aggregation mappings.
getMode()Gets current value of property mode.
getSelectedView()ID of the element which is the current target of the association selectedView, or null.
getShowSubSectionMore()Gets current value of property showSubSectionMore.
getVisible()Gets current value of property visible.
indexOfMapping(oMapping)Checks for the provided sap.uxap.ModelMapping in the aggregation mappings.
insertMapping(oMapping, iIndex)Inserts a mapping into the aggregation mappings.
removeAllMappings()Removes all the controls from the aggregation mappings.
removeMapping(vMapping)Removes a mapping from the aggregation mappings.
setColumnLayout(sLayout)Set the column layout for this particular block.
setFormAdjustment(sFormAdjustment)Sets a new value for property formAdjustment.
setMode(sMode)Set the view mode for this particular block.
setSelectedView(oSelectedView)Sets the associated selectedView.
setVisible()Setter for the visibility of the block.
Constructor Detail
new sap.uxap.BlockBase(sId?, mSettings?)
Constructor for a new BlockBase.

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:
{string}sId? id for the new control, generated automatically if no id is given
{object}mSettings? initial settings for the new control
Method Detail
sap.uxap.BlockBase.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.uxap.BlockBase 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:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.uxap.BlockBase.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.uxap.BlockBase.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addMapping(oMapping): sap.uxap.BlockBase
Adds some mapping to the aggregation mappings.
Parameters:
{sap.uxap.ModelMapping}oMapping the mapping to add; if empty, nothing is inserted
Returns:
{sap.uxap.BlockBase} Reference to this in order to allow method chaining
destroyMappings(): sap.uxap.BlockBase
Destroys all the mappings in the aggregation mappings.
Returns:
{sap.uxap.BlockBase} Reference to this in order to allow method chaining
getColumnLayout(): sap.uxap.BlockBaseColumnLayout
Gets current value of property columnLayout.

Determines on how columns the layout will be rendered. Allowed values are integers from 1 to 4 and "auto".

Default value is auto.

Returns:
{sap.uxap.BlockBaseColumnLayout} Value of property columnLayout
getFormAdjustment(): sap.uxap.BlockBaseFormAdjustment
Gets current value of property formAdjustment.

Determines if the block should automatically adjust its inner forms. Allowed values are "BlockColumns" and "OneColumn" and "None". If the value is "BlockColumns", then the inner form will have as many columns as the colspan of its parent block. If the value is "OneColumn", the inner form will have exactly one column, regardless the colspan of its parent block. If the value is "None", no automatic adjustment of inner forms will be made and the form will keep its original column count.

Default value is BlockColumns.

Returns:
{sap.uxap.BlockBaseFormAdjustment} Value of property formAdjustment
getMappings(): sap.uxap.ModelMapping[]
Gets content of aggregation mappings.

Map external UI5 model and internal Block model

Returns:
{sap.uxap.ModelMapping[]}
getMode(): string
Gets current value of property mode.

Determines the mode of the block. When block is used inside ObjectPage this mode is inherited my the SubSection. The mode of the block is changed when SubSection mode changes.

Returns:
{string} Value of property mode
getSelectedView(): sap.ui.core.Control
ID of the element which is the current target of the association selectedView, or null.
Returns:
{sap.ui.core.Control}
getShowSubSectionMore(): boolean
Gets current value of property showSubSectionMore.

Determines whether the show more button should be shown.

Default value is false.

Returns:
{boolean} Value of property showSubSectionMore
getVisible(): boolean
Gets current value of property visible.

Determines the visibility of the block.

Default value is true.

Returns:
{boolean} Value of property visible
indexOfMapping(oMapping): int
Checks for the provided sap.uxap.ModelMapping in the aggregation mappings. and returns its index if found or -1 otherwise.
Parameters:
{sap.uxap.ModelMapping}oMapping The mapping whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
insertMapping(oMapping, iIndex): sap.uxap.BlockBase
Inserts a mapping into the aggregation mappings.
Parameters:
{sap.uxap.ModelMapping}oMapping the mapping to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the mapping should be inserted at; for a negative value of iIndex, the mapping is inserted at position 0; for a value greater than the current size of the aggregation, the mapping is inserted at the last position
Returns:
{sap.uxap.BlockBase} Reference to this in order to allow method chaining
removeAllMappings(): sap.uxap.ModelMapping[]
Removes all the controls from the aggregation mappings.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.uxap.ModelMapping[]} An array of the removed elements (might be empty)
removeMapping(vMapping): sap.uxap.ModelMapping
Removes a mapping from the aggregation mappings.
Parameters:
{int|string|sap.uxap.ModelMapping}vMapping The mappingto remove or its index or id
Returns:
{sap.uxap.ModelMapping} The removed mapping or null
setColumnLayout(sLayout)
Set the column layout for this particular block.
Parameters:
{string}sLayout The column layout to apply to the control
setFormAdjustment(sFormAdjustment): sap.uxap.BlockBase
Sets a new value for property formAdjustment.

Determines if the block should automatically adjust its inner forms. Allowed values are "BlockColumns" and "OneColumn" and "None". If the value is "BlockColumns", then the inner form will have as many columns as the colspan of its parent block. If the value is "OneColumn", the inner form will have exactly one column, regardless the colspan of its parent block. If the value is "None", no automatic adjustment of inner forms will be made and the form will keep its original column count.

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

Default value is BlockColumns.

Parameters:
{sap.uxap.BlockBaseFormAdjustment}sFormAdjustment New value for property formAdjustment
Returns:
{sap.uxap.BlockBase} Reference to this in order to allow method chaining
setMode(sMode): *
Set the view mode for this particular block.
Parameters:
{string}sMode the mode to apply to the control (that should be synchronized with view declared)
Returns:
{*} this
setSelectedView(oSelectedView): sap.uxap.BlockBase
Sets the associated selectedView.
Parameters:
{sap.ui.core.Control}oSelectedView Id of an element which becomes the new target of this selectedView association; alternatively, an element instance may be given
Returns:
{sap.uxap.BlockBase} Reference to this in order to allow method chaining
setVisible()
Setter for the visibility of the block.