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.

Note: This control implements the SAP Fiori 1.0 design guidelines. For SAP Fiori 2.0, see the sap.f.semantic.SemanticPage.

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(mParameters?)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.
getFloatingFooter()Gets current value of property floatingFooter.
getLandmarkInfo()Gets content of aggregation landmarkInfo.
getSemanticRuleSet()Gets current value of property semanticRuleSet.
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.
setFloatingFooter(bFloatingFooter)Sets a new value for property floatingFooter.
setLandmarkInfo(oLandmarkInfo)Sets the aggregated landmarkInfo.
setSemanticRuleSet(sSemanticRuleSet)Sets a new value for property semanticRuleSet.
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:
stringsId?ID for the new control, generated automatically if no ID is given
objectmSettings?Initial settings for the new control
Event Detail
navButtonPress(oControlEvent)
See sap.m.Page#navButtonPress
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.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:
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.m.semantic.SemanticPage.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.semantic.SemanticPage.
Returns:
sap.ui.base.MetadataMetadata object describing this class
addContent(oContent): sap.m.semantic.SemanticPage
Adds some content to the aggregation content.
Parameters:
sap.ui.core.ControloContentthe content to add; if empty, nothing is inserted
Returns:
sap.m.semantic.SemanticPageReference to this in order to allow method chaining
addCustomFooterContent(oCustomFooterContent): sap.m.semantic.SemanticPage
Adds some customFooterContent to the aggregation customFooterContent.
Parameters:
sap.m.ButtonoCustomFooterContentthe customFooterContent to add; if empty, nothing is inserted
Returns:
sap.m.semantic.SemanticPageReference to this in order to allow method chaining
addCustomHeaderContent(oCustomHeaderContent): sap.m.semantic.SemanticPage
Adds some customHeaderContent to the aggregation customHeaderContent.
Parameters:
sap.m.ButtonoCustomHeaderContentthe customHeaderContent to add; if empty, nothing is inserted
Returns:
sap.m.semantic.SemanticPageReference 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:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.m.semantic.SemanticPage itself
Returns:
sap.m.semantic.SemanticPageReference 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.SemanticPageReference 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.SemanticPageReference 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.SemanticPageReference to this in order to allow method chaining
destroyLandmarkInfo(): sap.m.semantic.SemanticPage
Destroys the landmarkInfo in the aggregation landmarkInfo.
Returns:
sap.m.semantic.SemanticPageReference to this in order to allow method chaining
destroySubHeader(): sap.m.semantic.SemanticPage
Destroys the subHeader in the aggregation subHeader.
Returns:
sap.m.semantic.SemanticPageReference 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:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.m.semantic.SemanticPageReference to this in order to allow method chaining
fireNavButtonPress(mParameters?): sap.m.semantic.SemanticPage
Fires event navButtonPress to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
Returns:
sap.m.semantic.SemanticPageReference 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:
booleanValue of property enableScrolling
getFloatingFooter(): boolean

Gets current value of property floatingFooter.

Determines whether the floating footer behavior is enabled. If set to true, the content is visible when it's underneath the footer.

Default value is false.

Returns:
booleanValue of property floatingFooter
Since:
1.40.1

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
getSemanticRuleSet(): sap.m.semantic.SemanticRuleSetType

Gets current value of property semanticRuleSet.

Declares the type of semantic ruleset that will govern the styling and positioning of semantic content.

Default value is Classic.

Returns:
sap.m.semantic.SemanticRuleSetTypeValue of property semanticRuleSet
Since:
1.44
getShowFooter(): boolean

Gets current value of property showFooter.

Hides or shows the page footer

Default value is true.

Returns:
booleanValue of property showFooter
getShowNavButton(): boolean

Gets current value of property showNavButton.

See sap.m.Page#showNavButton

Default value is false.

Returns:
booleanValue of property showNavButton
getShowSubHeader(): boolean

Gets current value of property showSubHeader.

See sap.m.Page#showSubHeader

Default value is true.

Returns:
booleanValue 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:
stringValue 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.TitleLevelValue 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.ControloContentThe content whose index is looked for
Returns:
intThe 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.ButtonoCustomFooterContentThe customFooterContent whose index is looked for
Returns:
intThe 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.ButtonoCustomHeaderContentThe customHeaderContent whose index is looked for
Returns:
intThe 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.ControloContentthe content to insert; if empty, nothing is inserted
intiIndexthe 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.SemanticPageReference 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.ButtonoCustomFooterContentthe customFooterContent to insert; if empty, nothing is inserted
intiIndexthe 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.SemanticPageReference 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.ButtonoCustomHeaderContentthe customHeaderContent to insert; if empty, nothing is inserted
intiIndexthe 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.SemanticPageReference 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.ControlvContentThe content to remove or its index or id
Returns:
sap.ui.core.ControlThe removed content or null
removeCustomFooterContent(vCustomFooterContent): sap.m.Button
Removes a customFooterContent from the aggregation customFooterContent.
Parameters:
int|string|sap.m.ButtonvCustomFooterContentThe customFooterContent to remove or its index or id
Returns:
sap.m.ButtonThe removed customFooterContent or null
removeCustomHeaderContent(vCustomHeaderContent): sap.m.Button
Removes a customHeaderContent from the aggregation customHeaderContent.
Parameters:
int|string|sap.m.ButtonvCustomHeaderContentThe customHeaderContent to remove or its index or id
Returns:
sap.m.ButtonThe 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:
booleanbEnableScrollingNew value for property enableScrolling
Returns:
sap.m.semantic.SemanticPageReference to this in order to allow method chaining
setFloatingFooter(bFloatingFooter): sap.m.semantic.SemanticPage

Sets a new value for property floatingFooter.

Determines whether the floating footer behavior is enabled. If set to true, the content is visible when it's underneath the footer.

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

Default value is false.

Parameters:
booleanbFloatingFooterNew value for property floatingFooter
Returns:
sap.m.semantic.SemanticPageReference to this in order to allow method chaining
Since:
1.40.1
setLandmarkInfo(oLandmarkInfo): sap.m.semantic.SemanticPage
Sets the aggregated landmarkInfo.
Parameters:
sap.m.PageAccessibleLandmarkInfooLandmarkInfoThe landmarkInfo to set
Returns:
sap.m.semantic.SemanticPageReference to this in order to allow method chaining
setSemanticRuleSet(sSemanticRuleSet): sap.m.semantic.SemanticPage

Sets a new value for property semanticRuleSet.

Declares the type of semantic ruleset that will govern the styling and positioning of semantic content.

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

Default value is Classic.

Parameters:
sap.m.semantic.SemanticRuleSetTypesSemanticRuleSetNew value for property semanticRuleSet
Returns:
sap.m.semantic.SemanticPageReference to this in order to allow method chaining
Since:
1.44
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:
booleanbShowFooterNew value for property showFooter
Returns:
sap.m.semantic.SemanticPageReference 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:
booleanbShowNavButtonNew value for property showNavButton
Returns:
sap.m.semantic.SemanticPageReference 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:
booleanbShowSubHeaderNew value for property showSubHeader
Returns:
sap.m.semantic.SemanticPageReference to this in order to allow method chaining
setSubHeader(oSubHeader): sap.m.semantic.SemanticPage
Sets the aggregated subHeader.
Parameters:
sap.m.IBaroSubHeaderThe subHeader to set
Returns:
sap.m.semantic.SemanticPageReference 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:
stringsTitleNew value for property title
Returns:
sap.m.semantic.SemanticPageReference 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.TitleLevelsTitleLevelNew value for property titleLevel
Returns:
sap.m.semantic.SemanticPageReference to this in order to allow method chaining