Abstract Class sap.m.semantic.SemanticPageModule: sap/m/semantic/SemanticPage

extends Control
known direct subclasses: MasterPage, ShareMenuPage

A semantic page is an enhanced sap.m.Page, that can contain controls with semantic meaning @see sap.m.semantic.SemanticControl.

Content specified in the sap.m.semantic.SemanticPage#semanticControls aggregations will be automatically positioned in dedicated sections of the footer or the header of the page, depending on the control's semantics.
For example, a semantic button of type sap.m.semantic.PositiveAction will be positioned in the right side of the footer, and in logically correct sequence order with respect to any other included semantic controls.

The full list of what we internally define for semantic content is:

  • Visual properties (e.g. AddAction will be styled as an icon button)
  • Position in the page (UX guidelines specify that some buttons should be in the header only, while others are in the footer or the "share" menu, so we do the correct positioning)
  • Sequence order (UX guidelines define a specific sequence order of semantic controls with respect to each other)
  • Default localized tooltip for icon-only buttons
  • Overflow behavior (UX quidelines define which buttons are allowed to go to the overflow of the toolbar when the screen gets narrower). For icon buttons, we ensure that the text label of the button appears when the button is in overflow, as specified by UX.
  • Screen reader support (invisible text for reading the semantic type)

In addition to the predefined semantic controls, the SemanticPage can host also custom application-provided controls. It preserves most of the API of sap.m.Page for specifying page content.


Since: 1.30.0.
Constructor Summary
new sap.m.semantic.SemanticPage(sId?, mSettings?)Constructor for a new SemanticPage

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers.

Event Summary
navButtonPress(oControlEvent)See sap.m.Page#navButtonPress
Events borrowed from class sap.ui.core.Control
Method Summary
sap.m.semantic.SemanticPage.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.semantic.SemanticPage with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.semantic.SemanticPage.getMetadata()Returns a metadata object for class sap.m.semantic.SemanticPage.
addContent(oContent)Adds some content to the aggregation content.
addCustomFooterContent(oCustomFooterContent)Adds some customFooterContent to the aggregation customFooterContent.
addCustomHeaderContent(oCustomHeaderContent)Adds some customHeaderContent to the aggregation customHeaderContent.
attachNavButtonPress(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the navButtonPress event of this sap.m.semantic.SemanticPage.
destroyContent()Destroys all the content in the aggregation content.
destroyCustomFooterContent()Destroys all the customFooterContent in the aggregation customFooterContent.
destroyCustomHeaderContent()Destroys all the customHeaderContent in the aggregation customHeaderContent.
destroyLandmarkInfo()Destroys the landmarkInfo in the aggregation landmarkInfo.
destroySubHeader()Destroys the subHeader in the aggregation subHeader.
detachNavButtonPress(fnFunction, oListener)Detaches event handler fnFunction from the navButtonPress event of this sap.m.semantic.SemanticPage.
fireNavButtonPress(mArguments?)Fires event navButtonPress to attached listeners.
getContent()Gets content of aggregation content.
getCustomFooterContent()Gets content of aggregation customFooterContent.
getCustomHeaderContent()Gets content of aggregation customHeaderContent.
getEnableScrolling()Gets current value of property enableScrolling.
getLandmarkInfo()Gets content of aggregation landmarkInfo.
getShowFooter()Gets current value of property showFooter.
getShowNavButton()Gets current value of property showNavButton.
getShowSubHeader()Gets current value of property showSubHeader.
getSubHeader()Gets content of aggregation subHeader.
getTitle()Gets current value of property title.
getTitleLevel()Gets current value of property titleLevel.
indexOfContent(oContent)Checks for the provided sap.ui.core.Control in the aggregation content.
indexOfCustomFooterContent(oCustomFooterContent)Checks for the provided sap.m.Button in the aggregation customFooterContent.
indexOfCustomHeaderContent(oCustomHeaderContent)Checks for the provided sap.m.Button in the aggregation customHeaderContent.
insertContent(oContent, iIndex)Inserts a content into the aggregation content.
insertCustomFooterContent(oCustomFooterContent, iIndex)Inserts a customFooterContent into the aggregation customFooterContent.
insertCustomHeaderContent(oCustomHeaderContent, iIndex)Inserts a customHeaderContent into the aggregation customHeaderContent.
removeAllContent()Removes all the controls from the aggregation content.
removeAllCustomFooterContent()Removes all the controls from the aggregation customFooterContent.
removeAllCustomHeaderContent()Removes all the controls from the aggregation customHeaderContent.
removeContent(vContent)Removes a content from the aggregation content.
removeCustomFooterContent(vCustomFooterContent)Removes a customFooterContent from the aggregation customFooterContent.
removeCustomHeaderContent(vCustomHeaderContent)Removes a customHeaderContent from the aggregation customHeaderContent.
setEnableScrolling(bEnableScrolling)Sets a new value for property enableScrolling.
setLandmarkInfo(oLandmarkInfo)Sets the aggregated landmarkInfo.
setShowFooter(bShowFooter)Sets a new value for property showFooter.
setShowNavButton(bShowNavButton)Sets a new value for property showNavButton.
setShowSubHeader(bShowSubHeader)Sets a new value for property showSubHeader.
setSubHeader(oSubHeader)Sets the aggregated subHeader.
setTitle(sTitle)Sets a new value for property title.
setTitleLevel(sTitleLevel)Sets a new value for property titleLevel.
Constructor Detail
new sap.m.semantic.SemanticPage(sId?, mSettings?)
Constructor for a new SemanticPage

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
Event Detail
navButtonPress(oControlEvent)
See sap.m.Page#navButtonPress
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
Method Detail
sap.m.semantic.SemanticPage.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.semantic.SemanticPage 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.m.semantic.SemanticPage.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.semantic.SemanticPage.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addContent(oContent): sap.m.semantic.SemanticPage
Adds some content to the aggregation content.
Parameters:
{sap.ui.core.Control}oContent the content to add; if empty, nothing is inserted
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
addCustomFooterContent(oCustomFooterContent): sap.m.semantic.SemanticPage
Adds some customFooterContent to the aggregation customFooterContent.
Parameters:
{sap.m.Button}oCustomFooterContent the customFooterContent to add; if empty, nothing is inserted
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
addCustomHeaderContent(oCustomHeaderContent): sap.m.semantic.SemanticPage
Adds some customHeaderContent to the aggregation customHeaderContent.
Parameters:
{sap.m.Button}oCustomHeaderContent the customHeaderContent to add; if empty, nothing is inserted
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
attachNavButtonPress(oData?, fnFunction, oListener?): sap.m.semantic.SemanticPage
Attaches event handler fnFunction to the navButtonPress event of this sap.m.semantic.SemanticPage.

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.semantic.SemanticPage itself.

See sap.m.Page#navButtonPress

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.m.semantic.SemanticPage itself
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
destroyContent(): sap.m.semantic.SemanticPage
Destroys all the content in the aggregation content.
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
destroyCustomFooterContent(): sap.m.semantic.SemanticPage
Destroys all the customFooterContent in the aggregation customFooterContent.
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
destroyCustomHeaderContent(): sap.m.semantic.SemanticPage
Destroys all the customHeaderContent in the aggregation customHeaderContent.
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
destroyLandmarkInfo(): sap.m.semantic.SemanticPage
Destroys the landmarkInfo in the aggregation landmarkInfo.
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
destroySubHeader(): sap.m.semantic.SemanticPage
Destroys the subHeader in the aggregation subHeader.
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
detachNavButtonPress(fnFunction, oListener): sap.m.semantic.SemanticPage
Detaches event handler fnFunction from the navButtonPress event of this sap.m.semantic.SemanticPage.

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

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
fireNavButtonPress(mArguments?): sap.m.semantic.SemanticPage
Fires event navButtonPress to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
getContent(): sap.ui.core.Control[]
Gets content of aggregation content.

See sap.m.Page#content

Returns:
{sap.ui.core.Control[]}
getCustomFooterContent(): sap.m.Button[]
Gets content of aggregation customFooterContent.

Custom footer buttons

Returns:
{sap.m.Button[]}
getCustomHeaderContent(): sap.m.Button[]
Gets content of aggregation customHeaderContent.

Custom header buttons

Returns:
{sap.m.Button[]}
getEnableScrolling(): boolean
Gets current value of property enableScrolling.

See sap.m.Page#enableScrolling

Default value is true.

Returns:
{boolean} Value of property enableScrolling
Gets content of aggregation landmarkInfo.

Accessible landmark settings to be applied to the containers of the sap.m.Page control.

If not set, no landmarks will be written.

Returns:
{sap.m.PageAccessibleLandmarkInfo}
getShowFooter(): boolean
Gets current value of property showFooter.

Hides or shows the page footer

Default value is true.

Returns:
{boolean} Value of property showFooter
getShowNavButton(): boolean
Gets current value of property showNavButton.

See sap.m.Page#showNavButton

Default value is false.

Returns:
{boolean} Value of property showNavButton
getShowSubHeader(): boolean
Gets current value of property showSubHeader.

See sap.m.Page#showSubHeader

Default value is true.

Returns:
{boolean} Value of property showSubHeader
getSubHeader(): sap.m.IBar
Gets content of aggregation subHeader.

See sap.m.Page#subHeader

Returns:
{sap.m.IBar}
getTitle(): string
Gets current value of property title.

See sap.m.Page#title

Returns:
{string} Value of property title
getTitleLevel(): sap.ui.core.TitleLevel
Gets current value of property titleLevel.

See sap.m.Page#titleLevel

Default value is Auto.

Returns:
{sap.ui.core.TitleLevel} Value of property titleLevel
indexOfContent(oContent): int
Checks for the provided sap.ui.core.Control in the aggregation content. and returns its index if found or -1 otherwise.
Parameters:
{sap.ui.core.Control}oContent The content whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
indexOfCustomFooterContent(oCustomFooterContent): int
Checks for the provided sap.m.Button in the aggregation customFooterContent. and returns its index if found or -1 otherwise.
Parameters:
{sap.m.Button}oCustomFooterContent The customFooterContent whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
indexOfCustomHeaderContent(oCustomHeaderContent): int
Checks for the provided sap.m.Button in the aggregation customHeaderContent. and returns its index if found or -1 otherwise.
Parameters:
{sap.m.Button}oCustomHeaderContent The customHeaderContent whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
insertContent(oContent, iIndex): sap.m.semantic.SemanticPage
Inserts a content into the aggregation content.
Parameters:
{sap.ui.core.Control}oContent the content to insert; if empty, nothing is inserted
{int}iIndex 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
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
insertCustomFooterContent(oCustomFooterContent, iIndex): sap.m.semantic.SemanticPage
Inserts a customFooterContent into the aggregation customFooterContent.
Parameters:
{sap.m.Button}oCustomFooterContent the customFooterContent to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the customFooterContent should be inserted at; for a negative value of iIndex, the customFooterContent is inserted at position 0; for a value greater than the current size of the aggregation, the customFooterContent is inserted at the last position
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
insertCustomHeaderContent(oCustomHeaderContent, iIndex): sap.m.semantic.SemanticPage
Inserts a customHeaderContent into the aggregation customHeaderContent.
Parameters:
{sap.m.Button}oCustomHeaderContent the customHeaderContent to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the customHeaderContent should be inserted at; for a negative value of iIndex, the customHeaderContent is inserted at position 0; for a value greater than the current size of the aggregation, the customHeaderContent is inserted at the last position
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
removeAllContent(): sap.ui.core.Control[]
Removes all the controls from the aggregation content.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.ui.core.Control[]} An array of the removed elements (might be empty)
removeAllCustomFooterContent(): sap.m.Button[]
Removes all the controls from the aggregation customFooterContent.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.m.Button[]} An array of the removed elements (might be empty)
removeAllCustomHeaderContent(): sap.m.Button[]
Removes all the controls from the aggregation customHeaderContent.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.m.Button[]} An array of the removed elements (might be empty)
removeContent(vContent): sap.ui.core.Control
Removes a content from the aggregation content.
Parameters:
{int|string|sap.ui.core.Control}vContent The contentto remove or its index or id
Returns:
{sap.ui.core.Control} The removed content or null
removeCustomFooterContent(vCustomFooterContent): sap.m.Button
Removes a customFooterContent from the aggregation customFooterContent.
Parameters:
{int|string|sap.m.Button}vCustomFooterContent The customFooterContentto remove or its index or id
Returns:
{sap.m.Button} The removed customFooterContent or null
removeCustomHeaderContent(vCustomHeaderContent): sap.m.Button
Removes a customHeaderContent from the aggregation customHeaderContent.
Parameters:
{int|string|sap.m.Button}vCustomHeaderContent The customHeaderContentto remove or its index or id
Returns:
{sap.m.Button} The removed customHeaderContent or null
setEnableScrolling(bEnableScrolling): sap.m.semantic.SemanticPage
Sets a new value for property enableScrolling.

See sap.m.Page#enableScrolling

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

Default value is true.

Parameters:
{boolean}bEnableScrolling New value for property enableScrolling
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
setLandmarkInfo(oLandmarkInfo): sap.m.semantic.SemanticPage
Sets the aggregated landmarkInfo.
Parameters:
{sap.m.PageAccessibleLandmarkInfo}oLandmarkInfo The landmarkInfo to set
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
setShowFooter(bShowFooter): sap.m.semantic.SemanticPage
Sets a new value for property showFooter.

Hides or shows the page footer

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

Default value is true.

Parameters:
{boolean}bShowFooter New value for property showFooter
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
setShowNavButton(bShowNavButton): sap.m.semantic.SemanticPage
Sets a new value for property showNavButton.

See sap.m.Page#showNavButton

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

Default value is false.

Parameters:
{boolean}bShowNavButton New value for property showNavButton
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
setShowSubHeader(bShowSubHeader): sap.m.semantic.SemanticPage
Sets a new value for property showSubHeader.

See sap.m.Page#showSubHeader

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

Default value is true.

Parameters:
{boolean}bShowSubHeader New value for property showSubHeader
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
setSubHeader(oSubHeader): sap.m.semantic.SemanticPage
Sets the aggregated subHeader.
Parameters:
{sap.m.IBar}oSubHeader The subHeader to set
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
setTitle(sTitle): sap.m.semantic.SemanticPage
Sets a new value for property title.

See sap.m.Page#title

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

Parameters:
{string}sTitle New value for property title
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining
setTitleLevel(sTitleLevel): sap.m.semantic.SemanticPage
Sets a new value for property titleLevel.

See sap.m.Page#titleLevel

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

Default value is Auto.

Parameters:
{sap.ui.core.TitleLevel}sTitleLevel New value for property titleLevel
Returns:
{sap.m.semantic.SemanticPage} Reference to this in order to allow method chaining