class sap.ui.commons.ApplicationHeader

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/commons/ApplicationHeader
Application Component: CA-UI5-CTR

The application header control stands on the top of any application page. It consists of 4 areas: Logo area, Function area provided by application, Search area, Logout area.


Constructor

Constructor for a new ApplicationHeader.

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.ui.commons.ApplicationHeader(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
displayLogoff boolean true

Determines if the logoff area will be displayed at the right hand side of the application header.

Visibility: public
displayWelcome boolean true

Determines if the welcome text is displayed

Visibility: public
logoSrc sap.ui.core.URI

Path (src) to the logo icon to be displayed in the application header.

Visibility: public
logoText string

The text that will be displayed beside the logo in the application header. This property is optional.

Visibility: public
userName string

User name that will be displayed beside the welcome text

Visibility: public

Events Overview

Event Description
logoff

Fires an event to log off the user from the application. No parameters.

logoff

Fires an event to log off the user from the application. No parameters.

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

Methods Overview

Method Description
attachLogoff

Attaches event handler fnFunction to the logoff event of this sap.ui.commons.ApplicationHeader.

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.ui.commons.ApplicationHeader itself.

Fires an event to log off the user from the application. No parameters.

detachLogoff

Detaches event handler fnFunction from the logoff event of this sap.ui.commons.ApplicationHeader.

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

sap.ui.commons.ApplicationHeader.extend

Creates a new subclass of class sap.ui.commons.ApplicationHeader 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.

fireLogoff

Fires event logoff to attached listeners.

getDisplayLogoff

Gets current value of property displayLogoff.

Determines if the logoff area will be displayed at the right hand side of the application header.

Default value is true.

getDisplayWelcome

Gets current value of property displayWelcome.

Determines if the welcome text is displayed

Default value is true.

getLogoSrc

Gets current value of property logoSrc.

Path (src) to the logo icon to be displayed in the application header.

getLogoText

Gets current value of property logoText.

The text that will be displayed beside the logo in the application header. This property is optional.

sap.ui.commons.ApplicationHeader.getMetadata

Returns a metadata object for class sap.ui.commons.ApplicationHeader.

getUserName

Gets current value of property userName.

User name that will be displayed beside the welcome text

setDisplayLogoff

Sets a new value for property displayLogoff.

Determines if the logoff area will be displayed at the right hand side of the application header.

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

Default value is true.

setDisplayWelcome

Sets a new value for property displayWelcome.

Determines if the welcome text is displayed

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

Default value is true.

setLogoSrc

Sets a new value for property logoSrc.

Path (src) to the logo icon to be displayed in the application header.

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

setLogoText

Sets a new value for property logoText.

The text that will be displayed beside the logo in the application header. This property is optional.

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

setUserName

Sets a new value for property userName.

User name that will be displayed beside the welcome text

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

attachLogoff

Attaches event handler fnFunction to the logoff event of this sap.ui.commons.ApplicationHeader.

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.ui.commons.ApplicationHeader itself.

Fires an event to log off the user from the application. No parameters.

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.ui.commons.ApplicationHeader itself

detachLogoff

Detaches event handler fnFunction from the logoff event of this sap.ui.commons.ApplicationHeader.

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.ui.commons.ApplicationHeader.extend

Creates a new subclass of class sap.ui.commons.ApplicationHeader 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

fireLogoff

Fires event logoff to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

getDisplayLogoff

Gets current value of property displayLogoff.

Determines if the logoff area will be displayed at the right hand side of the application header.

Default value is true.

getDisplayWelcome

Gets current value of property displayWelcome.

Determines if the welcome text is displayed

Default value is true.

getLogoSrc

Gets current value of property logoSrc.

Path (src) to the logo icon to be displayed in the application header.

getLogoText

Gets current value of property logoText.

The text that will be displayed beside the logo in the application header. This property is optional.

sap.ui.commons.ApplicationHeader.getMetadata

Returns a metadata object for class sap.ui.commons.ApplicationHeader.

getUserName

Gets current value of property userName.

User name that will be displayed beside the welcome text

setDisplayLogoff

Sets a new value for property displayLogoff.

Determines if the logoff area will be displayed at the right hand side of the application header.

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
bDisplayLogoff boolean true

New value for property displayLogoff

setDisplayWelcome

Sets a new value for property displayWelcome.

Determines if the welcome text is displayed

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
bDisplayWelcome boolean true

New value for property displayWelcome

setLogoSrc

Sets a new value for property logoSrc.

Path (src) to the logo icon to be displayed in the application header.

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

Param Type DefaultValue Description
sLogoSrc sap.ui.core.URI

New value for property logoSrc

setLogoText

Sets a new value for property logoText.

The text that will be displayed beside the logo in the application header. This property is optional.

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

Param Type DefaultValue Description
sLogoText string

New value for property logoText

setUserName

Sets a new value for property userName.

User name that will be displayed beside the welcome text

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

Param Type DefaultValue Description
sUserName string

New value for property userName