class sap.f.cards.Header

Control sample: sap.f.cards.Header
Visiblity: public
UX Guidelines:
Implements: sap.f.cards.IHeader
Available since: N/A
Module: sap/f/cards/Header
Application Component: CA-UI5-CTR

Displays general information in the header of the sap.f.Card.

You can configure the title, subtitle, status text and icon, using the provided properties.

Notes:


Constructor

Constructor for a new Header.

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.f.cards.Header(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
iconAlt string empty string

Defines an alt text for the avatar or icon.

Visibility: public
iconBackgroundColor sap.m.AvatarColor Transparent

Defines a background color for the avatar or icon.

Visibility: public
iconDisplayShape sap.m.AvatarShape Circle

Defines the shape of the icon.

Visibility: public
iconInitials string empty string

Defines the initials of the icon.

Visibility: public
iconSrc sap.ui.core.URI empty string

Defines the icon source.

Visibility: public
statusText string empty string

Defines the status text.

Visibility: public
subtitle string empty string

Defines the subtitle.

Visibility: public
title string empty string

Defines the title.

Visibility: public

Borrowed Properties

Name Type Default Value Description
dataTimestamp string empty string

Defines the timestamp of the oldest data in the card. Use this to show to the end user how fresh the information in the card is.

Must be specified in ISO 8601 format.

Will be shown as a relative time like "5 minutes ago".

Visibility: public

Aggregations

Default Aggregation:

Name Cardinality Type Description
_avatar 0..1 sap.m.Avatar

Defines the inner avatar control.

_subtitle 0..1 sap.m.Text

Defines the inner subtitle control.

_title 0..1 sap.m.Text

Defines the inner title control.

Borrowed Aggregations

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

Defines the toolbar.

Since: 1.86.


Events Overview

Event Description
press

Fires when the user presses the control.

press

Fires when the user presses the control.

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

Methods Overview

Method Description
attachPress

Attaches event handler fnFunction to the press event of this sap.f.cards.Header.

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.f.cards.Header itself.

Fires when the user presses the control.

detachPress

Detaches event handler fnFunction from the press event of this sap.f.cards.Header.

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

sap.f.cards.Header.extend

Creates a new subclass of class sap.f.cards.Header with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.f.cards.BaseHeader.extend.

firePress

Fires event press to attached listeners.

getIconAlt

Gets current value of property iconAlt.

Defines an alt text for the avatar or icon.

Default value is empty string.

getIconBackgroundColor

Gets current value of property iconBackgroundColor.

Defines a background color for the avatar or icon.

Default value is Transparent.

getIconDisplayShape

Gets current value of property iconDisplayShape.

Defines the shape of the icon.

Default value is Circle.

getIconInitials

Gets current value of property iconInitials.

Defines the initials of the icon.

Default value is empty string.

getIconSrc

Gets current value of property iconSrc.

Defines the icon source.

Default value is empty string.

sap.f.cards.Header.getMetadata

Returns a metadata object for class sap.f.cards.Header.

getStatusText

Gets current value of property statusText.

Defines the status text.

Default value is empty string.

getSubtitle

Gets current value of property subtitle.

Defines the subtitle.

Default value is empty string.

getTitle

Gets current value of property title.

Defines the title.

Default value is empty string.

setIconAlt

Sets a new value for property iconAlt.

Defines an alt text for the avatar or icon.

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

Default value is empty string.

setIconBackgroundColor

Sets a new value for property iconBackgroundColor.

Defines a background color for the avatar or icon.

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

Default value is Transparent.

setIconDisplayShape

Sets a new value for property iconDisplayShape.

Defines the shape of the icon.

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

Default value is Circle.

setIconInitials

Sets a new value for property iconInitials.

Defines the initials of the icon.

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

Default value is empty string.

setIconSrc

Sets a new value for property iconSrc.

Defines the icon source.

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

Default value is empty string.

setStatusText

Sets a new value for property statusText.

Defines the status text.

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

Default value is empty string.

setSubtitle

Sets a new value for property subtitle.

Defines the subtitle.

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

Default value is empty string.

setTitle

Sets a new value for property title.

Defines the title.

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

Default value is empty string.

attachPress

Attaches event handler fnFunction to the press event of this sap.f.cards.Header.

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.f.cards.Header itself.

Fires when the user presses the control.

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.f.cards.Header itself

detachPress

Detaches event handler fnFunction from the press event of this sap.f.cards.Header.

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.f.cards.Header.extend

Creates a new subclass of class sap.f.cards.Header with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.f.cards.BaseHeader.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

firePress

Fires event press to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

getIconAlt

Gets current value of property iconAlt.

Defines an alt text for the avatar or icon.

Default value is empty string.

getIconBackgroundColor

Gets current value of property iconBackgroundColor.

Defines a background color for the avatar or icon.

Default value is Transparent.

getIconDisplayShape

Gets current value of property iconDisplayShape.

Defines the shape of the icon.

Default value is Circle.

getIconInitials

Gets current value of property iconInitials.

Defines the initials of the icon.

Default value is empty string.

getIconSrc

Gets current value of property iconSrc.

Defines the icon source.

Default value is empty string.

sap.f.cards.Header.getMetadata

Returns a metadata object for class sap.f.cards.Header.

getStatusText

Gets current value of property statusText.

Defines the status text.

Default value is empty string.

getSubtitle

Gets current value of property subtitle.

Defines the subtitle.

Default value is empty string.

getTitle

Gets current value of property title.

Defines the title.

Default value is empty string.

setIconAlt

Sets a new value for property iconAlt.

Defines an alt text for the avatar or icon.

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

Default value is empty string.

Param Type DefaultValue Description
sIconAlt string ""

New value for property iconAlt

setIconBackgroundColor

Sets a new value for property iconBackgroundColor.

Defines a background color for the avatar or icon.

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
sIconBackgroundColor sap.m.AvatarColor Transparent

New value for property iconBackgroundColor

setIconDisplayShape

Sets a new value for property iconDisplayShape.

Defines the shape of the icon.

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

Default value is Circle.

Param Type DefaultValue Description
sIconDisplayShape sap.m.AvatarShape Circle

New value for property iconDisplayShape

setIconInitials

Sets a new value for property iconInitials.

Defines the initials of the icon.

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

Default value is empty string.

Param Type DefaultValue Description
sIconInitials string ""

New value for property iconInitials

setIconSrc

Sets a new value for property iconSrc.

Defines the icon source.

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

Default value is empty string.

Param Type DefaultValue Description
sIconSrc sap.ui.core.URI ""

New value for property iconSrc

setStatusText

Sets a new value for property statusText.

Defines the status text.

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

Default value is empty string.

Param Type DefaultValue Description
sStatusText string ""

New value for property statusText

setSubtitle

Sets a new value for property subtitle.

Defines the subtitle.

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

Default value is empty string.

Param Type DefaultValue Description
sSubtitle string ""

New value for property subtitle

setTitle

Sets a new value for property title.

Defines the title.

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

Default value is empty string.

Param Type DefaultValue Description
sTitle string ""

New value for property title