class sap.m.NumericContent

Control sample: sap.m.NumericContent
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/m/NumericContent
Application Component: CA-UI5-SC

Shows numeric values used for example in tiles colored according to their meaning and displays deviations.


Constructor

Constructor for a new sap.m.GenericTile control.

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.m.NumericContent(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
adaptiveFontSize boolean true

If set to its default value true this property applies the appropriate font style class based on the language. When set to false the font size will always be large

Since: 1.73.

Visibility: public
animateTextChange boolean true

If set to true, the change of the value will be animated.

Visibility: public
formatterValue boolean false

If set to true, the value parameter contains a numeric value and scale. If set to false (default), the value parameter contains a numeric value only.

Visibility: public
icon sap.ui.core.URI

The icon to be displayed as a graphical element within the control. This can be an image or an icon from the icon font.

Visibility: public
iconDescription string

Description of an icon that is used in the tooltip.

Visibility: public
indicator sap.m.DeviationIndicator None

The indicator arrow that shows value deviation.

Visibility: public
nullifyValue boolean true

If set to true, the omitted value property is set to 0.

Visibility: public
scale string

The scaling prefix. Financial characters can be used for currencies and counters. The SI prefixes can be used for units. If the scaling prefix contains more than three characters, only the first three characters are displayed.

Visibility: public
size sap.m.Size Auto

Updates the size of the control. If not set, then the default size is applied based on the device tile.

Visibility: public
state sap.m.LoadState Loaded

Indicates the load status.

Visibility: public
truncateValueTo int

The number of characters of the value property to display.

Note If adaptiveFontSize is set to true the default value of this property will vary between languages. If adaptiveFontSize is set to false the default value of this property is 4.

Visibility: public
value string

The actual value.

Visibility: public
valueColor sap.m.ValueColor Neutral

The semantic color of the value.

Visibility: public
width sap.ui.core.CSSSize

The width of the control. If it is not set, the size of the control is defined by the 'size' property.

Visibility: public
withMargin boolean true

If the value is set to false, the content is adjusted to the whole size of the control.

Visibility: public

Events Overview

Event Description
press

The event is fired when the user chooses the numeric content.

press

The event is fired when the user chooses the numeric content.

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.m.NumericContent.

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

The event is fired when the user chooses the numeric content.

detachPress

Detaches event handler fnFunction from the press event of this sap.m.NumericContent.

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

sap.m.NumericContent.extend

Creates a new subclass of class sap.m.NumericContent 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.

firePress

Fires event press to attached listeners.

getAdaptiveFontSize

Gets current value of property adaptiveFontSize.

If set to its default value true this property applies the appropriate font style class based on the language. When set to false the font size will always be large

Default value is true.

getAnimateTextChange

Gets current value of property animateTextChange.

If set to true, the change of the value will be animated.

Default value is true.

getFormatterValue

Gets current value of property formatterValue.

If set to true, the value parameter contains a numeric value and scale. If set to false (default), the value parameter contains a numeric value only.

Default value is false.

getIcon

Gets current value of property icon.

The icon to be displayed as a graphical element within the control. This can be an image or an icon from the icon font.

getIconDescription

Gets current value of property iconDescription.

Description of an icon that is used in the tooltip.

getIndicator

Gets current value of property indicator.

The indicator arrow that shows value deviation.

Default value is "None".

sap.m.NumericContent.getMetadata

Returns a metadata object for class sap.m.NumericContent.

getNullifyValue

Gets current value of property nullifyValue.

If set to true, the omitted value property is set to 0.

Default value is true.

getScale

Gets current value of property scale.

The scaling prefix. Financial characters can be used for currencies and counters. The SI prefixes can be used for units. If the scaling prefix contains more than three characters, only the first three characters are displayed.

getSize

Gets current value of property size.

Updates the size of the control. If not set, then the default size is applied based on the device tile.

Default value is "Auto".

Since 1.38.0 The NumericContent control has now a fixed size, depending on the used media (desktop, tablet or phone).
getState

Gets current value of property state.

Indicates the load status.

Default value is "Loaded".

getTruncateValueTo

Gets current value of property truncateValueTo.

The number of characters of the value property to display.

Note If adaptiveFontSize is set to true the default value of this property will vary between languages. If adaptiveFontSize is set to false the default value of this property is 4.

getValue

Gets current value of property value.

The actual value.

getValueColor

Gets current value of property valueColor.

The semantic color of the value.

Default value is "Neutral".

getWidth

Gets current value of property width.

The width of the control. If it is not set, the size of the control is defined by the 'size' property.

getWithMargin

Gets current value of property withMargin.

If the value is set to false, the content is adjusted to the whole size of the control.

Default value is true.

setAdaptiveFontSize

Sets a new value for property adaptiveFontSize.

If set to its default value true this property applies the appropriate font style class based on the language. When set to false the font size will always be large

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

Default value is true.

setAnimateTextChange

Sets a new value for property animateTextChange.

If set to true, the change of the value will be animated.

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

Default value is true.

setFormatterValue

Sets a new value for property formatterValue.

If set to true, the value parameter contains a numeric value and scale. If set to false (default), the value parameter contains a numeric value only.

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

Default value is false.

setIcon

Sets a new value for property icon.

The icon to be displayed as a graphical element within the control. This can be an image or an icon from the icon font.

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

setIconDescription

Sets a new value for property iconDescription.

Description of an icon that is used in the tooltip.

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

setIndicator

Sets a new value for property indicator.

The indicator arrow that shows value deviation.

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

Default value is "None".

setNullifyValue

Sets a new value for property nullifyValue.

If set to true, the omitted value property is set to 0.

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

Default value is true.

setScale

Sets a new value for property scale.

The scaling prefix. Financial characters can be used for currencies and counters. The SI prefixes can be used for units. If the scaling prefix contains more than three characters, only the first three characters are displayed.

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

setSize

Sets a new value for property size.

Updates the size of the control. If not set, then the default size is applied based on the device tile.

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

Default value is "Auto".

Since 1.38.0 The NumericContent control has now a fixed size, depending on the used media (desktop, tablet or phone).
setState

Sets a new value for property state.

Indicates the load status.

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

Default value is "Loaded".

setTruncateValueTo

Sets a new value for property truncateValueTo.

The number of characters of the value property to display.

Note If adaptiveFontSize is set to true the default value of this property will vary between languages. If adaptiveFontSize is set to false the default value of this property is 4.

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

setValue

Sets a new value for property value.

The actual value.

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

setValueColor

Sets a new value for property valueColor.

The semantic color of the value.

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

Default value is "Neutral".

setWidth

Sets a new value for property width.

The width of the control. If it is not set, the size of the control is defined by the 'size' property.

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

setWithMargin

Sets a new value for property withMargin.

If the value is set to false, the content is adjusted to the whole size of the control.

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

Default value is true.

attachPress

Attaches event handler fnFunction to the press event of this sap.m.NumericContent.

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

The event is fired when the user chooses the numeric content.

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.m.NumericContent itself

detachPress

Detaches event handler fnFunction from the press event of this sap.m.NumericContent.

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.m.NumericContent.extend

Creates a new subclass of class sap.m.NumericContent 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

firePress

Fires event press to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

getAdaptiveFontSize

Gets current value of property adaptiveFontSize.

If set to its default value true this property applies the appropriate font style class based on the language. When set to false the font size will always be large

Default value is true.

getAnimateTextChange

Gets current value of property animateTextChange.

If set to true, the change of the value will be animated.

Default value is true.

getFormatterValue

Gets current value of property formatterValue.

If set to true, the value parameter contains a numeric value and scale. If set to false (default), the value parameter contains a numeric value only.

Default value is false.

getIcon

Gets current value of property icon.

The icon to be displayed as a graphical element within the control. This can be an image or an icon from the icon font.

getIconDescription

Gets current value of property iconDescription.

Description of an icon that is used in the tooltip.

getIndicator

Gets current value of property indicator.

The indicator arrow that shows value deviation.

Default value is "None".

sap.m.NumericContent.getMetadata

Returns a metadata object for class sap.m.NumericContent.

getNullifyValue

Gets current value of property nullifyValue.

If set to true, the omitted value property is set to 0.

Default value is true.

getScale

Gets current value of property scale.

The scaling prefix. Financial characters can be used for currencies and counters. The SI prefixes can be used for units. If the scaling prefix contains more than three characters, only the first three characters are displayed.

getSize

Gets current value of property size.

Updates the size of the control. If not set, then the default size is applied based on the device tile.

Default value is "Auto".

Since 1.38.0 The NumericContent control has now a fixed size, depending on the used media (desktop, tablet or phone).

getState

Gets current value of property state.

Indicates the load status.

Default value is "Loaded".

getTruncateValueTo

Gets current value of property truncateValueTo.

The number of characters of the value property to display.

Note If adaptiveFontSize is set to true the default value of this property will vary between languages. If adaptiveFontSize is set to false the default value of this property is 4.

getValue

Gets current value of property value.

The actual value.

getValueColor

Gets current value of property valueColor.

The semantic color of the value.

Default value is "Neutral".

getWidth

Gets current value of property width.

The width of the control. If it is not set, the size of the control is defined by the 'size' property.

getWithMargin

Gets current value of property withMargin.

If the value is set to false, the content is adjusted to the whole size of the control.

Default value is true.

setAdaptiveFontSize

Sets a new value for property adaptiveFontSize.

If set to its default value true this property applies the appropriate font style class based on the language. When set to false the font size will always be large

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

New value for property adaptiveFontSize

setAnimateTextChange

Sets a new value for property animateTextChange.

If set to true, the change of the value will be animated.

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

New value for property animateTextChange

setFormatterValue

Sets a new value for property formatterValue.

If set to true, the value parameter contains a numeric value and scale. If set to false (default), the value parameter contains a numeric value only.

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

Default value is false.

Param Type DefaultValue Description
bFormatterValue boolean false

New value for property formatterValue

setIcon

Sets a new value for property icon.

The icon to be displayed as a graphical element within the control. This can be an image or an icon from the icon font.

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

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

New value for property icon

setIconDescription

Sets a new value for property iconDescription.

Description of an icon that is used in the tooltip.

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

Param Type DefaultValue Description
sIconDescription string

New value for property iconDescription

setIndicator

Sets a new value for property indicator.

The indicator arrow that shows value deviation.

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

Default value is "None".

Param Type DefaultValue Description
sIndicator sap.m.DeviationIndicator "None"

New value for property indicator

setNullifyValue

Sets a new value for property nullifyValue.

If set to true, the omitted value property is set to 0.

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

New value for property nullifyValue

setScale

Sets a new value for property scale.

The scaling prefix. Financial characters can be used for currencies and counters. The SI prefixes can be used for units. If the scaling prefix contains more than three characters, only the first three characters are displayed.

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

Param Type DefaultValue Description
sScale string

New value for property scale

setSize

Sets a new value for property size.

Updates the size of the control. If not set, then the default size is applied based on the device tile.

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

Default value is "Auto".

Since 1.38.0 The NumericContent control has now a fixed size, depending on the used media (desktop, tablet or phone).
Param Type DefaultValue Description
sSize sap.m.Size "Auto"

New value for property size

setState

Sets a new value for property state.

Indicates the load status.

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

Default value is "Loaded".

Param Type DefaultValue Description
sState sap.m.LoadState "Loaded"

New value for property state

setTruncateValueTo

Sets a new value for property truncateValueTo.

The number of characters of the value property to display.

Note If adaptiveFontSize is set to true the default value of this property will vary between languages. If adaptiveFontSize is set to false the default value of this property is 4.

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

Param Type DefaultValue Description
iTruncateValueTo int

New value for property truncateValueTo

setValue

Sets a new value for property value.

The actual value.

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

Param Type DefaultValue Description
sValue string

New value for property value

setValueColor

Sets a new value for property valueColor.

The semantic color of the value.

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

Default value is "Neutral".

Param Type DefaultValue Description
sValueColor sap.m.ValueColor "Neutral"

New value for property valueColor

setWidth

Sets a new value for property width.

The width of the control. If it is not set, the size of the control is defined by the 'size' property.

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

Param Type DefaultValue Description
sWidth sap.ui.core.CSSSize

New value for property width

setWithMargin

Sets a new value for property withMargin.

If the value is set to false, the content is adjusted to the whole size of the control.

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

New value for property withMargin