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

extends Control

The main element that holds the content that is displayed in an ObjectPageLayout, but not necessarily only there.

Overview

The blocks give the flexibility to combine different content types.

A block is a control that:

  • Has modes and a view associated to each mode. At rendering time, the view associated to the mode is rendered.
  • Can use all view types for storing its internal control tree (XML, JS, JSON, HTML)

As any UI5 view, the XML view can have a controller which automatically comes with a this.oParentBlock attribute (so that the controller can interact with the block). If the controller implements the onParentBlockModeChange method, this method will be called with the sMode parameter when the view is used or reused 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.
setShowSubSectionMore(bShowSubSectionMore)Sets a new value for property showSubSectionMore.
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:
stringsId?ID for the new control, generated automatically if no ID is given
objectmSettings?Initial settings for the new control
See:
{@link topic:4527729576cb4a4888275b6935aad03a Block Base}
{@link topic:2978f6064742456ebed31c5ccf4d051d Creating Blocks}
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:
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.uxap.BlockBase.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.uxap.BlockBase.
Returns:
sap.ui.base.MetadataMetadata object describing this class
addMapping(oMapping): sap.uxap.BlockBase
Adds some mapping to the aggregation mappings.
Parameters:
sap.uxap.ModelMappingoMappingThe mapping to add; if empty, nothing is inserted
Returns:
sap.uxap.BlockBaseReference to this in order to allow method chaining
destroyMappings(): sap.uxap.BlockBase
Destroys all the mappings in the aggregation mappings.
Returns:
sap.uxap.BlockBaseReference to this in order to allow method chaining
getColumnLayout(): sap.uxap.BlockBaseColumnLayout

Gets current value of property columnLayout.

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

Default value is auto.

Returns:
sap.uxap.BlockBaseColumnLayoutValue 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.BlockBaseFormAdjustmentValue 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:
stringValue of property mode
getSelectedView(): sap.ui.core.ID
ID of the element which is the current target of the association selectedView, or null.
Returns:
sap.ui.core.ID
getShowSubSectionMore(): boolean

Gets current value of property showSubSectionMore.

Determines whether the show more button should be shown.

Note: The property will take effect if the BlockBase is inside and would be ignored in case the BlockBase is nested inside another BlockBase.

Default value is false.

Returns:
booleanValue of property showSubSectionMore
getVisible(): boolean

Gets current value of property visible.

Determines the visibility of the block.

Default value is true.

Returns:
booleanValue 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.ModelMappingoMappingThe mapping whose index is looked for
Returns:
intThe 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.ModelMappingoMappingThe mapping to insert; if empty, nothing is inserted
intiIndexThe 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.BlockBaseReference 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.ModelMappingvMappingThe mapping to remove or its index or id
Returns:
sap.uxap.ModelMappingThe removed mapping or null
setColumnLayout(sLayout)
Set the column layout for this particular block.
Parameters:
stringsLayoutThe 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.BlockBaseFormAdjustmentsFormAdjustmentNew value for property formAdjustment
Returns:
sap.uxap.BlockBaseReference to this in order to allow method chaining
setMode(sMode): *
Set the view mode for this particular block.
Parameters:
stringsModethe 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.ID|sap.ui.core.ControloSelectedViewID of an element which becomes the new target of this selectedView association; alternatively, an element instance may be given
Returns:
sap.uxap.BlockBaseReference to this in order to allow method chaining
setShowSubSectionMore(bShowSubSectionMore): sap.uxap.BlockBase

Sets a new value for property showSubSectionMore.

Determines whether the show more button should be shown.

Note: The property will take effect if the BlockBase is inside and would be ignored in case the BlockBase is nested inside another BlockBase.

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

Default value is false.

Parameters:
booleanbShowSubSectionMoreNew value for property showSubSectionMore
Returns:
sap.uxap.BlockBaseReference to this in order to allow method chaining
setVisible()
Setter for the visibility of the block.