Class sap.ui.commons.ApplicationHeaderModule: sap/ui/commons/ApplicationHeader

extends Control

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.

Deprecated API:Since version 1.38. Instead, use the sap.tnt.ToolHeader control.

Constructor Summary
new sap.ui.commons.ApplicationHeader(sId?, mSettings?)Constructor for a new ApplicationHeader.
Event Summary
logoff(oControlEvent)Fires an event to log off the user from the application.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.commons.ApplicationHeader.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.commons.ApplicationHeader with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.commons.ApplicationHeader.getMetadata()Returns a metadata object for class sap.ui.commons.ApplicationHeader.
attachLogoff(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the logoff event of this sap.ui.commons.ApplicationHeader.
detachLogoff(fnFunction, oListener)Detaches event handler fnFunction from the logoff event of this sap.ui.commons.ApplicationHeader.
fireLogoff(mArguments?)Fires event logoff to attached listeners.
getDisplayLogoff()Gets current value of property displayLogoff.
getDisplayWelcome()Gets current value of property displayWelcome.
getLogoSrc()Gets current value of property logoSrc.
getLogoText()Gets current value of property logoText.
getUserName()Gets current value of property userName.
setDisplayLogoff(bDisplayLogoff)Sets a new value for property displayLogoff.
setDisplayWelcome(bDisplayWelcome)Sets a new value for property displayWelcome.
setLogoSrc(sLogoSrc)Sets a new value for property logoSrc.
setLogoText(sLogoText)Sets a new value for property logoText.
setUserName(sUserName)Sets a new value for property userName.
Constructor Detail
new sap.ui.commons.ApplicationHeader(sId?, mSettings?)
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 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
Deprecated:
Since version 1.38. Instead, use the sap.tnt.ToolHeader control.
Event Detail
logoff(oControlEvent)
Fires an event to log off the user from the application. No parameters.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
Method Detail
sap.ui.commons.ApplicationHeader.extend(sClassName, oClassInfo?, FNMetaImpl?): function
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.

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.ui.commons.ApplicationHeader.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.commons.ApplicationHeader.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
attachLogoff(oData?, fnFunction, oListener?): sap.ui.commons.ApplicationHeader
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.

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.ui.commons.ApplicationHeader itself
Returns:
{sap.ui.commons.ApplicationHeader} Reference to this in order to allow method chaining
detachLogoff(fnFunction, oListener): sap.ui.commons.ApplicationHeader
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.

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.ui.commons.ApplicationHeader} Reference to this in order to allow method chaining
fireLogoff(mArguments?): sap.ui.commons.ApplicationHeader
Fires event logoff to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.commons.ApplicationHeader} Reference to this in order to allow method chaining
getDisplayLogoff(): boolean
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.

Returns:
{boolean} Value of property displayLogoff
getDisplayWelcome(): boolean
Gets current value of property displayWelcome.

Determines if the welcome text is displayed

Default value is true.

Returns:
{boolean} Value of property displayWelcome
getLogoSrc(): sap.ui.core.URI
Gets current value of property logoSrc.

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

Returns:
{sap.ui.core.URI} Value of property logoSrc
getLogoText(): string
Gets current value of property logoText.

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

Returns:
{string} Value of property logoText
getUserName(): string
Gets current value of property userName.

User name that will be displayed beside the welcome text

Returns:
{string} Value of property userName
setDisplayLogoff(bDisplayLogoff): sap.ui.commons.ApplicationHeader
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.

Parameters:
{boolean}bDisplayLogoff New value for property displayLogoff
Returns:
{sap.ui.commons.ApplicationHeader} Reference to this in order to allow method chaining
setDisplayWelcome(bDisplayWelcome): sap.ui.commons.ApplicationHeader
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.

Parameters:
{boolean}bDisplayWelcome New value for property displayWelcome
Returns:
{sap.ui.commons.ApplicationHeader} Reference to this in order to allow method chaining
setLogoSrc(sLogoSrc): sap.ui.commons.ApplicationHeader
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.

Parameters:
{sap.ui.core.URI}sLogoSrc New value for property logoSrc
Returns:
{sap.ui.commons.ApplicationHeader} Reference to this in order to allow method chaining
setLogoText(sLogoText): sap.ui.commons.ApplicationHeader
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.

Parameters:
{string}sLogoText New value for property logoText
Returns:
{sap.ui.commons.ApplicationHeader} Reference to this in order to allow method chaining
setUserName(sUserName): sap.ui.commons.ApplicationHeader
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.

Parameters:
{string}sUserName New value for property userName
Returns:
{sap.ui.commons.ApplicationHeader} Reference to this in order to allow method chaining