class sap.tnt.InfoLabel

Control sample: sap.tnt.InfoLabel
Visiblity: public
UX Guidelines:
Implements: sap.ui.core.IFormContent
Available since: N/A
Module: sap/tnt/InfoLabel
Application Component: CA-UI5-CTR

The InfoLabel is a small non-interactive control which contains text information and non-semantic color chosen from a list of predefined color schemes. It serves the purpose to attract the user attention to some piece of information (state, quantity, condition, etc.).

Overview

The control visualizes text information without user interaction. The text inside the control is always in upper case. It can have smaller or larger side paddings which can be specified by the renderMode property. The text-background color pair can be changed by setting a number between 1 and 10 that corresponds to the 10 predefined color combinations of the colorScheme property. The control is designed to be vertically aligned with UI5 Input and Button control families. When using InfoLabel in non-editable Forms, Tables, etc., set displayOnly=true for best visual results.

Usage Guidelines


Constructor

Constructor for a new InfoLabel.

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.tnt.InfoLabel(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
colorScheme int 7

Specifies the fill and text color of the control. Accepts a number between 1 and 10 as a value. You can choose from 10 predefined background and text color combinations. The color schemes are non-semantic, you can select them according to your own preferences. Note: ColorScheme 10 is available only in Fiori 3 theme. The default colorScheme is 7.

Visibility: public
displayOnly boolean false

Determines if the InfoLabel is in displayOnly mode. When set to true the control size adjusts to fit other controls, for example non-editable Forms.

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

Defines the icon to be displayed as graphical element within the InfoLabel. It can be an icon from the icon font.

Since: 1.74.

Visibility: public
renderMode sap.tnt.RenderMode Loose

Specifies the type of the InfoLabel paddings - loose or narrow. Note: By default the padding is loose. It is recommended to use narrow (smaller) paddings for numeric texts.

Visibility: public
text string empty string

Specifies the text inside the InfoLabel control.

Visibility: public
textDirection sap.ui.core.TextDirection Inherit

Available options for the text direction are LTR and RTL. By default the control inherits the text direction from its parent control.

Visibility: public
width sap.ui.core.CSSSize

Specifies the width of the InfoLabel control. By default, the InfoLabel control has the width of the content. Set this property to restrict the width to a custom value.

Visibility: public

Methods Overview

Method Description
bindText

Binds property text to model data.

See ManagedObject.bindProperty for a detailed description of the possible properties of oBindingInfo

sap.tnt.InfoLabel.extend

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

getColorScheme

Gets current value of property colorScheme.

Specifies the fill and text color of the control. Accepts a number between 1 and 10 as a value. You can choose from 10 predefined background and text color combinations. The color schemes are non-semantic, you can select them according to your own preferences. Note: ColorScheme 10 is available only in Fiori 3 theme. The default colorScheme is 7.

Default value is 7.

getDisplayOnly

Gets current value of property displayOnly.

Determines if the InfoLabel is in displayOnly mode. When set to true the control size adjusts to fit other controls, for example non-editable Forms.

Default value is false.

getIcon

Gets current value of property icon.

Defines the icon to be displayed as graphical element within the InfoLabel. It can be an icon from the icon font.

Default value is empty string.

sap.tnt.InfoLabel.getMetadata

Returns a metadata object for class sap.tnt.InfoLabel.

getRenderMode

Gets current value of property renderMode.

Specifies the type of the InfoLabel paddings - loose or narrow. Note: By default the padding is loose. It is recommended to use narrow (smaller) paddings for numeric texts.

Default value is Loose.

getText

Gets current value of property text.

Specifies the text inside the InfoLabel control.

Default value is empty string.

getTextDirection

Gets current value of property textDirection.

Available options for the text direction are LTR and RTL. By default the control inherits the text direction from its parent control.

Default value is Inherit.

getWidth

Gets current value of property width.

Specifies the width of the InfoLabel control. By default, the InfoLabel control has the width of the content. Set this property to restrict the width to a custom value.

setColorScheme

Sets a new value for property colorScheme.

Specifies the fill and text color of the control. Accepts a number between 1 and 10 as a value. You can choose from 10 predefined background and text color combinations. The color schemes are non-semantic, you can select them according to your own preferences. Note: ColorScheme 10 is available only in Fiori 3 theme. The default colorScheme is 7.

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

Default value is 7.

setDisplayOnly

Sets a new value for property displayOnly.

Determines if the InfoLabel is in displayOnly mode. When set to true the control size adjusts to fit other controls, for example non-editable Forms.

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.

Defines the icon to be displayed as graphical element within the InfoLabel. It can be an icon from the icon font.

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

Default value is empty string.

setRenderMode

Sets a new value for property renderMode.

Specifies the type of the InfoLabel paddings - loose or narrow. Note: By default the padding is loose. It is recommended to use narrow (smaller) paddings for numeric texts.

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

Default value is Loose.

setText

Sets a new value for property text.

Specifies the text inside the InfoLabel control.

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

Default value is empty string.

setTextDirection

Sets a new value for property textDirection.

Available options for the text direction are LTR and RTL. By default the control inherits the text direction from its parent control.

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

Default value is Inherit.

setWidth

Sets a new value for property width.

Specifies the width of the InfoLabel control. By default, the InfoLabel control has the width of the content. Set this property to restrict the width to a custom value.

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

unbindText

Unbinds property text from model data.

bindText

Binds property text to model data.

See ManagedObject.bindProperty for a detailed description of the possible properties of oBindingInfo

Param Type DefaultValue Description
oBindingInfo sap.ui.base.ManagedObject.PropertyBindingInfo

The binding information

sap.tnt.InfoLabel.extend

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

getColorScheme

Gets current value of property colorScheme.

Specifies the fill and text color of the control. Accepts a number between 1 and 10 as a value. You can choose from 10 predefined background and text color combinations. The color schemes are non-semantic, you can select them according to your own preferences. Note: ColorScheme 10 is available only in Fiori 3 theme. The default colorScheme is 7.

Default value is 7.

getDisplayOnly

Gets current value of property displayOnly.

Determines if the InfoLabel is in displayOnly mode. When set to true the control size adjusts to fit other controls, for example non-editable Forms.

Default value is false.

getIcon

Gets current value of property icon.

Defines the icon to be displayed as graphical element within the InfoLabel. It can be an icon from the icon font.

Default value is empty string.

sap.tnt.InfoLabel.getMetadata

Returns a metadata object for class sap.tnt.InfoLabel.

getRenderMode

Gets current value of property renderMode.

Specifies the type of the InfoLabel paddings - loose or narrow. Note: By default the padding is loose. It is recommended to use narrow (smaller) paddings for numeric texts.

Default value is Loose.

getText

Gets current value of property text.

Specifies the text inside the InfoLabel control.

Default value is empty string.

getTextDirection

Gets current value of property textDirection.

Available options for the text direction are LTR and RTL. By default the control inherits the text direction from its parent control.

Default value is Inherit.

getWidth

Gets current value of property width.

Specifies the width of the InfoLabel control. By default, the InfoLabel control has the width of the content. Set this property to restrict the width to a custom value.

setColorScheme

Sets a new value for property colorScheme.

Specifies the fill and text color of the control. Accepts a number between 1 and 10 as a value. You can choose from 10 predefined background and text color combinations. The color schemes are non-semantic, you can select them according to your own preferences. Note: ColorScheme 10 is available only in Fiori 3 theme. The default colorScheme is 7.

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

Default value is 7.

Param Type DefaultValue Description
iColorScheme int 7

New value for property colorScheme

setDisplayOnly

Sets a new value for property displayOnly.

Determines if the InfoLabel is in displayOnly mode. When set to true the control size adjusts to fit other controls, for example non-editable Forms.

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
bDisplayOnly boolean false

New value for property displayOnly

setIcon

Sets a new value for property icon.

Defines the icon to be displayed as graphical element within the InfoLabel. It can be an icon from the icon font.

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
sIcon sap.ui.core.URI ""

New value for property icon

setRenderMode

Sets a new value for property renderMode.

Specifies the type of the InfoLabel paddings - loose or narrow. Note: By default the padding is loose. It is recommended to use narrow (smaller) paddings for numeric texts.

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

Default value is Loose.

Param Type DefaultValue Description
sRenderMode sap.tnt.RenderMode Loose

New value for property renderMode

setText

Sets a new value for property text.

Specifies the text inside the InfoLabel control.

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
sText string ""

New value for property text

setTextDirection

Sets a new value for property textDirection.

Available options for the text direction are LTR and RTL. By default the control inherits the text direction from its parent control.

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

Default value is Inherit.

Param Type DefaultValue Description
sTextDirection sap.ui.core.TextDirection Inherit

New value for property textDirection

setWidth

Sets a new value for property width.

Specifies the width of the InfoLabel control. By default, the InfoLabel control has the width of the content. Set this property to restrict the width to a custom value.

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

unbindText

Unbinds property text from model data.