class sap.m.HeaderContainer

Control sample: sap.m.HeaderContainer
Visiblity: public
UX Guidelines:
Implements: sap.m.ObjectHeaderContainer
Available since: N/A
Module: sap/m/HeaderContainer
Application Component: CA-UI5-SC

The container that provides a horizontal layout. It provides a horizontal scrolling on the mobile devices. On the desktop, it provides scroll left and scroll right buttons. This control supports keyboard navigation. You can use left and right arrow keys to navigate through the inner content. The Home key puts focus on the first control and the End key puts focus on the last control. Use Enter or Space key to choose the control.


Constructor

Constructor for the new HeaderContainer control.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.

new sap.m.HeaderContainer(sId?, mSettings?)
Param Type Default Value Description
sId? string

ID for the new control, generated automatically if no id is given

mSettings? object

initial settings for the new control


Properties

Name Type Default Value Description
backgroundDesign sap.m.BackgroundDesign Transparent

Specifies the background color of the content. The visualization of the different options depends on the used theme.

Visibility: public
height sap.ui.core.CSSSize

The height of the whole HeaderContainer. If not specified, it is rendered as 'auto' in horizontal orientation and as '100%' in vertical orientation.

Visibility: public
orientation sap.ui.core.Orientation Horizontal

The orientation of the HeaderContainer. There are two orientation modes: horizontal and vertical. In horizontal mode the content controls are displayed next to each other, in vertical mode the content controls are displayed on top of each other.

Visibility: public
scrollStep int 300

Number of pixels to scroll when the user chooses Next or Previous buttons. Relevant only for desktop.

Visibility: public
scrollStepByItem int 1

Number of items to scroll when the user chose Next or Previous buttons. Relevant only for desktop. Have priority over 'ScrollStep'. Have to be positive number.

Visibility: public
scrollTime int 500

Scroll animation time in milliseconds.

Visibility: public
showDividers boolean true

If set to true, it shows dividers between the different content controls.

Visibility: public
showOverflowItem boolean true

Indicates whether the incomplete item on the edge of visible area is displayed or hidden.

Visibility: public
width sap.ui.core.CSSSize

The width of the whole HeaderContainer. If not specified, it is rendered as '100%' in horizontal orientation and as 'auto' in vertical orientation.

Visibility: public

Aggregations

Default Aggregation: content

Name Cardinality Type Description
_nextButton 0..1 sap.ui.core.Control

Button that allows to scroll to next section.

_prevButton 0..1 sap.ui.core.Control

Button that allows to scroll to previous section.

_scrollContainer 0..1 sap.m.ScrollContainer

Scroll container for smooth scrolling on different platforms.

content (default) 0..n sap.ui.core.Control

Content to add to HeaderContainer.


Associations

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

Controls or IDs that label controls in the content aggregation. Each ariaLabelledBy item is assigned to its appropriate counterpart in the content aggregation.
If you want to annotate all the controls in the content aggregation, add the same number of items to the ariaLabelledBy annotation.
Can be used by screen reader software.

Since: 1.62.0.


Events Overview

Event Description
scroll

This event is triggered on pressing the scroll button.

scroll

This event is triggered on pressing the scroll button.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

Methods Overview

Method Description
addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

addContent

Adds some content to the aggregation content.

attachScroll

Attaches event handler fnFunction to the scroll event of this sap.m.HeaderContainer.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.m.HeaderContainer itself.

This event is triggered on pressing the scroll button.

destroyContent

Destroys all the content in the aggregation content.

detachScroll

Detaches event handler fnFunction from the scroll event of this sap.m.HeaderContainer.

The passed function and listener object must match the ones used for event registration.

sap.m.HeaderContainer.extend

Creates a new subclass of class sap.m.HeaderContainer 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.

fireScroll

Fires event scroll to attached listeners.

getAriaLabelledBy

Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.

getBackgroundDesign

Gets current value of property backgroundDesign.

Specifies the background color of the content. The visualization of the different options depends on the used theme.

Default value is Transparent.

getContent

Gets content of aggregation content.

Content to add to HeaderContainer.

getHeight

Gets current value of property height.

The height of the whole HeaderContainer. If not specified, it is rendered as 'auto' in horizontal orientation and as '100%' in vertical orientation.

sap.m.HeaderContainer.getMetadata

Returns a metadata object for class sap.m.HeaderContainer.

getOrientation

Gets current value of property orientation.

The orientation of the HeaderContainer. There are two orientation modes: horizontal and vertical. In horizontal mode the content controls are displayed next to each other, in vertical mode the content controls are displayed on top of each other.

Default value is Horizontal.

getScrollStep

Gets current value of property scrollStep.

Number of pixels to scroll when the user chooses Next or Previous buttons. Relevant only for desktop.

Default value is 300.

getScrollStepByItem

Gets current value of property scrollStepByItem.

Number of items to scroll when the user chose Next or Previous buttons. Relevant only for desktop. Have priority over 'ScrollStep'. Have to be positive number.

Default value is 1.

getScrollTime

Gets current value of property scrollTime.

Scroll animation time in milliseconds.

Default value is 500.

getShowDividers

Gets current value of property showDividers.

If set to true, it shows dividers between the different content controls.

Default value is true.

getShowOverflowItem

Gets current value of property showOverflowItem.

Indicates whether the incomplete item on the edge of visible area is displayed or hidden.

Default value is true.

getWidth

Gets current value of property width.

The width of the whole HeaderContainer. If not specified, it is rendered as '100%' in horizontal orientation and as 'auto' in vertical orientation.

indexOfContent

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

insertContent

Inserts a content into the aggregation content.

removeAllAriaLabelledBy

Removes all the controls in the association named ariaLabelledBy.

removeAllContent

Removes all the controls from the aggregation content.

Additionally, it unregisters them from the hosting UIArea.

removeAriaLabelledBy

Removes an ariaLabelledBy from the association named ariaLabelledBy.

removeContent

Removes a content from the aggregation content.

setBackgroundDesign

Sets a new value for property backgroundDesign.

Specifies the background color of the content. The visualization of the different options depends on the used theme.

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

Default value is Transparent.

setHeight

Sets a new value for property height.

The height of the whole HeaderContainer. If not specified, it is rendered as 'auto' in horizontal orientation and as '100%' in vertical orientation.

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

setOrientation

Sets a new value for property orientation.

The orientation of the HeaderContainer. There are two orientation modes: horizontal and vertical. In horizontal mode the content controls are displayed next to each other, in vertical mode the content controls are displayed on top of each other.

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

Default value is Horizontal.

setScrollStep

Sets a new value for property scrollStep.

Number of pixels to scroll when the user chooses Next or Previous buttons. Relevant only for desktop.

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

Default value is 300.

setScrollStepByItem

Sets a new value for property scrollStepByItem.

Number of items to scroll when the user chose Next or Previous buttons. Relevant only for desktop. Have priority over 'ScrollStep'. Have to be positive number.

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

Default value is 1.

setScrollTime

Sets a new value for property scrollTime.

Scroll animation time in milliseconds.

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

Default value is 500.

setShowDividers

Sets a new value for property showDividers.

If set to true, it shows dividers between the different content controls.

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

Default value is true.

setShowOverflowItem

Sets a new value for property showOverflowItem.

Indicates whether the incomplete item on the edge of visible area is displayed or hidden.

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

Default value is true.

setWidth

Sets a new value for property width.

The width of the whole HeaderContainer. If not specified, it is rendered as '100%' in horizontal orientation and as 'auto' in vertical orientation.

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

addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

Param Type DefaultValue Description
vAriaLabelledBy sap.ui.core.ID sap.ui.core.Control

The ariaLabelledBy to add; if empty, nothing is inserted

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

attachScroll

Attaches event handler fnFunction to the scroll event of this sap.m.HeaderContainer.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.m.HeaderContainer itself.

This event is triggered on pressing the scroll button.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.m.HeaderContainer itself

destroyContent

Destroys all the content in the aggregation content.

detachScroll

Detaches event handler fnFunction from the scroll event of this sap.m.HeaderContainer.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

sap.m.HeaderContainer.extend

Creates a new subclass of class sap.m.HeaderContainer 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.

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

fireScroll

Fires event scroll to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

getAriaLabelledBy

Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.

getBackgroundDesign

Gets current value of property backgroundDesign.

Specifies the background color of the content. The visualization of the different options depends on the used theme.

Default value is Transparent.

getContent

Gets content of aggregation content.

Content to add to HeaderContainer.

getHeight

Gets current value of property height.

The height of the whole HeaderContainer. If not specified, it is rendered as 'auto' in horizontal orientation and as '100%' in vertical orientation.

sap.m.HeaderContainer.getMetadata

Returns a metadata object for class sap.m.HeaderContainer.

getOrientation

Gets current value of property orientation.

The orientation of the HeaderContainer. There are two orientation modes: horizontal and vertical. In horizontal mode the content controls are displayed next to each other, in vertical mode the content controls are displayed on top of each other.

Default value is Horizontal.

getScrollStep

Gets current value of property scrollStep.

Number of pixels to scroll when the user chooses Next or Previous buttons. Relevant only for desktop.

Default value is 300.

getScrollStepByItem

Gets current value of property scrollStepByItem.

Number of items to scroll when the user chose Next or Previous buttons. Relevant only for desktop. Have priority over 'ScrollStep'. Have to be positive number.

Default value is 1.

getScrollTime

Gets current value of property scrollTime.

Scroll animation time in milliseconds.

Default value is 500.

getShowDividers

Gets current value of property showDividers.

If set to true, it shows dividers between the different content controls.

Default value is true.

getShowOverflowItem

Gets current value of property showOverflowItem.

Indicates whether the incomplete item on the edge of visible area is displayed or hidden.

Default value is true.

getWidth

Gets current value of property width.

The width of the whole HeaderContainer. If not specified, it is rendered as '100%' in horizontal orientation and as 'auto' in vertical orientation.

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

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

removeAllAriaLabelledBy

Removes all the controls in the association named ariaLabelledBy.

removeAllContent

Removes all the controls from the aggregation content.

Additionally, it unregisters them from the hosting UIArea.

removeAriaLabelledBy

Removes an ariaLabelledBy from the association named ariaLabelledBy.

Param Type DefaultValue Description
vAriaLabelledBy int sap.ui.core.ID sap.ui.core.Control

The ariaLabelledBy to be removed or its index or ID

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

setBackgroundDesign

Sets a new value for property backgroundDesign.

Specifies the background color of the content. The visualization of the different options depends on the used theme.

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

Default value is Transparent.

Param Type DefaultValue Description
sBackgroundDesign sap.m.BackgroundDesign Transparent

New value for property backgroundDesign

setHeight

Sets a new value for property height.

The height of the whole HeaderContainer. If not specified, it is rendered as 'auto' in horizontal orientation and as '100%' in vertical orientation.

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

Param Type DefaultValue Description
sHeight sap.ui.core.CSSSize

New value for property height

setOrientation

Sets a new value for property orientation.

The orientation of the HeaderContainer. There are two orientation modes: horizontal and vertical. In horizontal mode the content controls are displayed next to each other, in vertical mode the content controls are displayed on top of each other.

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

Default value is Horizontal.

Param Type DefaultValue Description
sOrientation sap.ui.core.Orientation Horizontal

New value for property orientation

setScrollStep

Sets a new value for property scrollStep.

Number of pixels to scroll when the user chooses Next or Previous buttons. Relevant only for desktop.

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

Default value is 300.

Param Type DefaultValue Description
iScrollStep int 300

New value for property scrollStep

setScrollStepByItem

Sets a new value for property scrollStepByItem.

Number of items to scroll when the user chose Next or Previous buttons. Relevant only for desktop. Have priority over 'ScrollStep'. Have to be positive number.

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

Default value is 1.

Param Type DefaultValue Description
iScrollStepByItem int 1

New value for property scrollStepByItem

setScrollTime

Sets a new value for property scrollTime.

Scroll animation time in milliseconds.

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

Default value is 500.

Param Type DefaultValue Description
iScrollTime int 500

New value for property scrollTime

setShowDividers

Sets a new value for property showDividers.

If set to true, it shows dividers between the different content controls.

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

Default value is true.

Param Type DefaultValue Description
bShowDividers boolean true

New value for property showDividers

setShowOverflowItem

Sets a new value for property showOverflowItem.

Indicates whether the incomplete item on the edge of visible area is displayed or hidden.

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

Default value is true.

Param Type DefaultValue Description
bShowOverflowItem boolean true

New value for property showOverflowItem

setWidth

Sets a new value for property width.

The width of the whole HeaderContainer. If not specified, it is rendered as '100%' in horizontal orientation and as 'auto' in vertical orientation.

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

Param Type DefaultValue Description
sWidth sap.ui.core.CSSSize

New value for property width