The sap.m.GenericTag
control displays app-specific, essential information.
The control consists of four different parts:
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 |
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 |
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. |
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. |
Method | Description |
---|---|
addAriaLabelledBy |
Adds some ariaLabelledBy into the association ariaLabelledBy. |
attachPress |
Attaches event handler When called, the context of the event handler (its Fired when the user clicks/taps on the control. |
destroyValue |
Destroys the value in the aggregation value. |
detachPress |
Detaches event handler 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
|
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 |
sap.m.GenericTag.getMetadata |
Returns a metadata object for class sap.m.GenericTag. |
getOverflowToolbarConfig |
Sets the behavior of the |
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 |
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 |
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 Default value is |
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 Default value is |
setStatus |
Sets the Default value is |
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 Default value is |
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 When called with a value of Default value is |
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 |
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 |
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 |
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 |
Fires event press to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Gets current value of property design.
Determines the visual mode of the control.
Default value is Full
.
Sets the behavior of the GenericTag
inside an OverflowToolbar
configuration.
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
.
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
.
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
.
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 |
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 |
Sets the status
property.
Default value is None
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sStatus | sap.ui.core.ValueState |
New value for property |
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 |
Sets the aggregated value.
Param | Type | DefaultValue | Description |
---|---|---|---|
oValue | sap.m.ObjectNumber |
The value to set |
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 |