class sap.m.GenericTag

Control sample: sap.m.GenericTag
Visiblity: public
UX Guidelines:
Implements: sap.m.IOverflowToolbarContentsap.m.IOverflowToolbarFlexibleContent
Available since: N/A
Module: sap/m/GenericTag
Application Component: CA-UI5-CTR

The sap.m.GenericTag control displays app-specific, essential information.

Structure

The control consists of four different parts:


Constructor

Constructor for a new sap.m.GenericTag.

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.GenericTag(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
design sap.m.GenericTagDesign Full

Determines the visual mode of the control.

Visibility: public
status sap.ui.core.ValueState None

Determines the control status that is represented in different colors, including the color bar and the color and type of the displayed icon.

Visibility: public
text string empty string

Defines the text rendered by the control. It's a value-descriptive text rendered on one line.

Visibility: public
valueState sap.m.GenericTagValueState None

Determines the state of the control.

Note: When the error state is set, a warning type of icon is displayed that overrides the control set through the value aggregation.

Visibility: public

Aggregations

Default Aggregation: value

Name Cardinality Type Description
_errorIcon 0..1 sap.ui.core.Icon

Icon for visualization when error is thrown.

_statusIcon 0..1 sap.ui.core.Icon

Icon indicating the status of the control.

value (default) 0..1 sap.m.ObjectNumber

Numeric value rendered by the control.


Associations

Name Cardinality Type Description
ariaLabelledBy 0..n sap.ui.core.Control

Association to controls / ids which label this control (see WAI-ARIA attribute aria-labelledBy). Note: This is a downported feature introduced in version 1.97.0.

Since: 1.96.4.


Events Overview

Event Description
press

Fired when the user clicks/taps on the control.

press

Fired when the user clicks/taps on the control.

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

Methods Overview

Method Description
addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

attachPress

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

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

Fired when the user clicks/taps on the control.

destroyValue

Destroys the value in the aggregation value.

detachPress

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

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

sap.m.GenericTag.extend

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

getAriaLabelledBy

Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.

getDesign

Gets current value of property design.

Determines the visual mode of the control.

Default value is Full.

sap.m.GenericTag.getMetadata

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

getOverflowToolbarConfig

Sets the behavior of the GenericTag inside an OverflowToolbar configuration.

getStatus

Gets current value of property status.

Determines the control status that is represented in different colors, including the color bar and the color and type of the displayed icon.

Default value is None.

getText

Gets current value of property text.

Defines the text rendered by the control. It's a value-descriptive text rendered on one line.

Default value is empty string.

getValue

Gets content of aggregation value.

Numeric value rendered by the control.

getValueState

Gets current value of property valueState.

Determines the state of the control.

Note: When the error state is set, a warning type of icon is displayed that overrides the control set through the value aggregation.

Default value is None.

removeAllAriaLabelledBy

Removes all the controls in the association named ariaLabelledBy.

removeAriaLabelledBy

Removes an ariaLabelledBy from the association named ariaLabelledBy.

setDesign

Sets a new value for property design.

Determines the visual mode of the control.

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

Default value is Full.

setStatus

Sets the status property.

Default value is None.

setText

Sets a new value for property text.

Defines the text rendered by the control. It's a value-descriptive text rendered on one line.

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

Default value is empty string.

setValue

Sets the aggregated value.

setValueState

Sets a new value for property valueState.

Determines the state of the control.

Note: When the error state is set, a warning type of icon is displayed that overrides the control set through the value aggregation.

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

Default value is None.

addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

Param Type DefaultValue Description
vAriaLabelledBy sap.ui.core.ID sap.ui.core.Control

The ariaLabelledBy to add; if empty, nothing is inserted

attachPress

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

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

Fired when the user clicks/taps on 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.m.GenericTag itself

destroyValue

Destroys the value in the aggregation value.

detachPress

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

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

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

getAriaLabelledBy

Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.

getDesign

Gets current value of property design.

Determines the visual mode of the control.

Default value is Full.

sap.m.GenericTag.getMetadata

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

getOverflowToolbarConfig

Sets the behavior of the GenericTag inside an OverflowToolbar configuration.

getStatus

Gets current value of property status.

Determines the control status that is represented in different colors, including the color bar and the color and type of the displayed icon.

Default value is None.

getText

Gets current value of property text.

Defines the text rendered by the control. It's a value-descriptive text rendered on one line.

Default value is empty string.

getValue

Gets content of aggregation value.

Numeric value rendered by the control.

getValueState

Gets current value of property valueState.

Determines the state of the control.

Note: When the error state is set, a warning type of icon is displayed that overrides the control set through the value aggregation.

Default value is None.

removeAllAriaLabelledBy

Removes all the controls in the association named ariaLabelledBy.

removeAriaLabelledBy

Removes an ariaLabelledBy from the association named ariaLabelledBy.

Param Type DefaultValue Description
vAriaLabelledBy int sap.ui.core.ID sap.ui.core.Control

The ariaLabelledBy to be removed or its index or ID

setDesign

Sets a new value for property design.

Determines the visual mode of the control.

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

Default value is Full.

Param Type DefaultValue Description
sDesign sap.m.GenericTagDesign Full

New value for property design

setStatus

Sets the status property.

Default value is None.

Param Type DefaultValue Description
sStatus sap.ui.core.ValueState

New value for property status.

setText

Sets a new value for property text.

Defines the text rendered by the control. It's a value-descriptive text rendered on one line.

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

setValue

Sets the aggregated value.

Param Type DefaultValue Description
oValue sap.m.ObjectNumber

The value to set

setValueState

Sets a new value for property valueState.

Determines the state of the control.

Note: When the error state is set, a warning type of icon is displayed that overrides the control set through the value aggregation.

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
sValueState sap.m.GenericTagValueState None

New value for property valueState