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.
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
. addMapping(oMapping)Adds some mapping to the 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
. 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
. removeMapping(vMapping)Removes a mapping from the aggregation mappings
. setMode(sMode)Set the view mode for this particular block. setVisible()Setter for the visibility of the block. addStyleClass,
allowTextSelection,
attachBrowserEvent,
attachValidateFieldGroup,
checkFieldGroupIds,
detachBrowserEvent,
detachValidateFieldGroup,
fireValidateFieldGroup,
getAccessibilityInfo,
getBusy,
getBusyIndicatorDelay,
getControlsByFieldGroupId,
getFieldGroupIds,
getIdForLabel,
getRenderer,
hasStyleClass,
invalidate,
isBusy,
onAfterRendering,
onBeforeRendering,
placeAt,
removeStyleClass,
rerender,
setBusy,
setBusyIndicatorDelay,
setFieldGroupIds,
toggleStyleClass,
triggerValidateFieldGroup $,
addCustomData,
addDependent,
addEventDelegate,
applyFocusInfo,
bindElement,
data,
destroy,
destroyCustomData,
destroyDependents,
destroyLayoutData,
destroyTooltip,
enhanceAccessibilityState,
exit,
findElements,
fireEvent,
focus,
getCustomData,
getDependents,
getDomRef,
getElementBinding,
getFocusDomRef,
getFocusInfo,
getInterface,
getLayoutData,
getMetadata,
getTooltip,
getTooltip_AsString,
getTooltip_Text,
indexOfCustomData,
indexOfDependent,
init,
insertCustomData,
insertDependent,
prop,
removeAllCustomData,
removeAllDependents,
removeCustomData,
removeDependent,
removeEventDelegate,
setLayoutData,
setTooltip,
toString,
unbindElement addAggregation,
addAssociation,
applySettings,
attachFormatError,
attachModelContextChange,
attachParseError,
attachValidationError,
attachValidationSuccess,
bindAggregation,
bindContext,
bindObject,
bindProperty,
destroyAggregation,
detachFormatError,
detachModelContextChange,
detachParseError,
detachValidationError,
detachValidationSuccess,
findAggregatedObjects,
fireFormatError,
fireModelContextChange,
fireParseError,
fireValidationError,
fireValidationSuccess,
getAggregation,
getAssociation,
getBinding,
getBindingContext,
getBindingInfo,
getBindingPath,
getEventingParent,
getId,
getModel,
getObjectBinding,
getOriginInfo,
getParent,
getProperty,
hasModel,
indexOfAggregation,
insertAggregation,
isBound,
isInvalidateSuppressed,
isTreeBinding,
propagateMessages,
removeAggregation,
removeAllAggregation,
removeAllAssociation,
removeAssociation,
setAggregation,
setAssociation,
setBindingContext,
setProperty,
unbindAggregation,
unbindContext,
unbindObject,
unbindProperty,
validateAggregation,
validateProperty 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:
- Properties
- Aggregations
- mappings : sap.uxap.ModelMapping[] (default)
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 |
Returns a metadata object for class sap.uxap.BlockBase.
Returns:
Adds some mapping to the aggregation mappings
.
Parameters:
Returns:
Destroys all the mappings in the aggregation mappings
.
Returns:
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:
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:
Gets content of aggregation
mappings
.
Map external UI5 model and internal Block model
Returns:
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 |
ID of the element which is the current target of the association selectedView
, or null
.
Returns:
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:
Returns:
{int} | The index of the provided control in the aggregation if found, or -1 otherwise |
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:
Removes all the controls from the aggregation
mappings
.
Additionally, it unregisters them from the hosting UIArea.
Returns:
Removes a mapping from the aggregation mappings
.
Parameters:
Returns:
setColumnLayout(sLayout)
Set the column layout for this particular block.
Parameters:
{string} | sLayout | The column layout to apply to the control |
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:
Returns:
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:
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:
setVisible()
Setter for the visibility of the block.