class sap.f.cards.NumericHeader

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

Displays general information in the header of the sap.f.Card and allows the configuration of a numeric value visualization.

You can configure the title, subtitle, and status text, using the provided properties. To add more side number indicators, use the sideIndicators aggregation.

Notes:


Constructor

Constructor for a new NumericHeader.

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.NumericHeader(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
details string

Additional text which adds more details to what is shown in the numeric header.

Visibility: public
number string

The numeric value of the main number indicator. If the value contains more than five characters, only the first five are displayed. Without rounding the number.

Visibility: public
scale string

Defines the unit of measurement (scaling prefix) for the main indicator. Financial characters can be used for currencies and counters. The International System of Units (SI) prefixes can be used. If the unit contains more than three characters, only the first three characters are displayed.

Visibility: public
sideIndicatorsAlignment sap.f.cards.NumericHeaderSideIndicatorsAlignment Begin

The alignment of the side indicators.

Visibility: public
state sap.m.ValueColor Neutral

The semantic color which represents the state of the main number indicator.

Visibility: public
statusText string empty string

Defines the status text.

Visibility: public
subtitle string

The subtitle of the card

Visibility: public
title string

The title of the card

Visibility: public
trend sap.m.DeviationIndicator None

The direction of the trend arrow. Shows deviation for the value of the main number indicator.

Visibility: public
unitOfMeasurement string

General unit of measurement for the header. Displayed as side information to the subtitle.

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
_details 0..1 sap.m.Text

Display details

_mainIndicator 0..1 sap.m.NumericContent

Displays the main number indicator

_subtitle 0..1 sap.m.Text

Used to display subtitle text

_title 0..1 sap.m.Text

Used to display title text

_unitOfMeasurement 0..1 sap.m.Text

Shows unit of measurement next to subtitle

sideIndicators 0..n sap.f.cards.NumericSideIndicator

Additional side number indicators. For example "Deviation" and "Target". Not more than two side indicators should be used.

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
addSideIndicator

Adds some sideIndicator to the aggregation sideIndicators.

attachPress

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

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.NumericHeader itself.

Fires when the user presses the control.

destroySideIndicators

Destroys all the sideIndicators in the aggregation sideIndicators.

detachPress

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

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

sap.f.cards.NumericHeader.extend

Creates a new subclass of class sap.f.cards.NumericHeader 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.

getDetails

Gets current value of property details.

Additional text which adds more details to what is shown in the numeric header.

sap.f.cards.NumericHeader.getMetadata

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

getNumber

Gets current value of property number.

The numeric value of the main number indicator. If the value contains more than five characters, only the first five are displayed. Without rounding the number.

getScale

Gets current value of property scale.

Defines the unit of measurement (scaling prefix) for the main indicator. Financial characters can be used for currencies and counters. The International System of Units (SI) prefixes can be used. If the unit contains more than three characters, only the first three characters are displayed.

getSideIndicators

Gets content of aggregation sideIndicators.

Additional side number indicators. For example "Deviation" and "Target". Not more than two side indicators should be used.

getSideIndicatorsAlignment

Gets current value of property sideIndicatorsAlignment.

The alignment of the side indicators.

Default value is "Begin".

getState

Gets current value of property state.

The semantic color which represents the state of the main number indicator.

Default value is "Neutral".

getStatusText

Gets current value of property statusText.

Defines the status text.

Default value is empty string.

getSubtitle

Gets current value of property subtitle.

The subtitle of the card

getTitle

Gets current value of property title.

The title of the card

getTrend

Gets current value of property trend.

The direction of the trend arrow. Shows deviation for the value of the main number indicator.

Default value is "None".

getUnitOfMeasurement

Gets current value of property unitOfMeasurement.

General unit of measurement for the header. Displayed as side information to the subtitle.

indexOfSideIndicator

Checks for the provided sap.f.cards.NumericSideIndicator in the aggregation sideIndicators. and returns its index if found or -1 otherwise.

insertSideIndicator

Inserts a sideIndicator into the aggregation sideIndicators.

removeAllSideIndicators

Removes all the controls from the aggregation sideIndicators.

Additionally, it unregisters them from the hosting UIArea.

removeSideIndicator

Removes a sideIndicator from the aggregation sideIndicators.

setDetails

Sets additional text which adds more details to what is shown in the numeric header.

setNumber

Sets the value of the main number indicator.

setScale

Sets the unit of measurement (scaling prefix) for the main indicator.

setSideIndicatorsAlignment

Sets a new value for property sideIndicatorsAlignment.

The alignment of the side indicators.

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

Default value is "Begin".

setState

Sets the semantic color which represents the state of the main number indicator.

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 the subtitle.

setTitle

Sets the title.

setTrend

Sets the direction of the trend arrow.

setUnitOfMeasurement

Sets the general unit of measurement for the header. Displayed as side information to the subtitle.

addSideIndicator

Adds some sideIndicator to the aggregation sideIndicators.

Param Type DefaultValue Description
oSideIndicator sap.f.cards.NumericSideIndicator

The sideIndicator to add; if empty, nothing is inserted

attachPress

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

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.NumericHeader 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.NumericHeader itself

destroySideIndicators

Destroys all the sideIndicators in the aggregation sideIndicators.

detachPress

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

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.NumericHeader.extend

Creates a new subclass of class sap.f.cards.NumericHeader 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

getDetails

Gets current value of property details.

Additional text which adds more details to what is shown in the numeric header.

sap.f.cards.NumericHeader.getMetadata

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

getNumber

Gets current value of property number.

The numeric value of the main number indicator. If the value contains more than five characters, only the first five are displayed. Without rounding the number.

getScale

Gets current value of property scale.

Defines the unit of measurement (scaling prefix) for the main indicator. Financial characters can be used for currencies and counters. The International System of Units (SI) prefixes can be used. If the unit contains more than three characters, only the first three characters are displayed.

getSideIndicators

Gets content of aggregation sideIndicators.

Additional side number indicators. For example "Deviation" and "Target". Not more than two side indicators should be used.

getSideIndicatorsAlignment

Gets current value of property sideIndicatorsAlignment.

The alignment of the side indicators.

Default value is "Begin".

getState

Gets current value of property state.

The semantic color which represents the state of the main number indicator.

Default value is "Neutral".

getStatusText

Gets current value of property statusText.

Defines the status text.

Default value is empty string.

getSubtitle

Gets current value of property subtitle.

The subtitle of the card

getTitle

Gets current value of property title.

The title of the card

getTrend

Gets current value of property trend.

The direction of the trend arrow. Shows deviation for the value of the main number indicator.

Default value is "None".

getUnitOfMeasurement

Gets current value of property unitOfMeasurement.

General unit of measurement for the header. Displayed as side information to the subtitle.

indexOfSideIndicator

Checks for the provided sap.f.cards.NumericSideIndicator in the aggregation sideIndicators. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oSideIndicator sap.f.cards.NumericSideIndicator

The sideIndicator whose index is looked for

insertSideIndicator

Inserts a sideIndicator into the aggregation sideIndicators.

Param Type DefaultValue Description
oSideIndicator sap.f.cards.NumericSideIndicator

The sideIndicator to insert; if empty, nothing is inserted

iIndex int

The 0-based index the sideIndicator should be inserted at; for a negative value of iIndex, the sideIndicator is inserted at position 0; for a value greater than the current size of the aggregation, the sideIndicator is inserted at the last position

removeAllSideIndicators

Removes all the controls from the aggregation sideIndicators.

Additionally, it unregisters them from the hosting UIArea.

removeSideIndicator

Removes a sideIndicator from the aggregation sideIndicators.

Param Type DefaultValue Description
vSideIndicator int string sap.f.cards.NumericSideIndicator

The sideIndicator to remove or its index or id

setDetails

Sets additional text which adds more details to what is shown in the numeric header.

Param Type DefaultValue Description
sValue string

The text of the details

setNumber

Sets the value of the main number indicator.

Param Type DefaultValue Description
sValue string

A string representation of the number

setScale

Sets the unit of measurement (scaling prefix) for the main indicator.

Param Type DefaultValue Description
sValue string

The text of the title

setSideIndicatorsAlignment

Sets a new value for property sideIndicatorsAlignment.

The alignment of the side indicators.

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

Default value is "Begin".

Param Type DefaultValue Description
sSideIndicatorsAlignment sap.f.cards.NumericHeaderSideIndicatorsAlignment "Begin"

New value for property sideIndicatorsAlignment

setState

Sets the semantic color which represents the state of the main number indicator.

Param Type DefaultValue Description
sValue sap.m.ValueColor

The semantic color which represents the state

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 the subtitle.

Param Type DefaultValue Description
sValue string

The text of the subtitle

setTitle

Sets the title.

Param Type DefaultValue Description
sValue string

The text of the title

setTrend

Sets the direction of the trend arrow.

Param Type DefaultValue Description
sValue sap.m.DeviationIndicator

The direction of the trend arrow

setUnitOfMeasurement

Sets the general unit of measurement for the header. Displayed as side information to the subtitle.

Param Type DefaultValue Description
sValue string

The value of the unit of measurement