The ObjectNumber control displays number and number unit properties for an object. The number can be displayed using semantic colors to provide additional meaning about the object to the user.
With 1.63, large design of the control is supported by setting sapMObjectNumberLarge
CSS class to the ObjectNumber
.
Note: To fulfill the design guidelines when you are using sapMObjectNumberLarge
CSS class set the emphasized
property to false
.
Constructor for a new ObjectNumber.
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.ObjectNumber(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 |
---|---|---|---|
active | boolean | false | Indicates if the Note: If you set this property to |
emphasized | boolean | true | Indicates if the object number should appear emphasized. Visibility: public |
emptyIndicatorMode | sap.m.EmptyIndicatorMode | Off | Specifies if an empty indicator should be displayed when there is no number. |
inverted | boolean | false | Determines whether the background color reflects the set |
number | string | Defines the number field. Visibility: public |
|
numberUnit | string | Defines the number units qualifier. Visibility: public |
|
state | sap.ui.core.ValueState | None | Determines the object number's value state. Setting this state will cause the number to be rendered in state-specific colors. Visibility: public |
textAlign | sap.ui.core.TextAlign | Begin | Sets the horizontal alignment of the number and unit. Visibility: public |
textDirection | sap.ui.core.TextDirection | Inherit | Available options for the number and unit text direction are LTR(left-to-right) and RTL(right-to-left). By default, the control inherits the text direction from its parent control. Visibility: public |
unit | string | Defines the number units qualifier. If numberUnit and unit are both set, the unit value is used. |
Name | Cardinality | Type | Description |
---|---|---|---|
ariaDescribedBy | 0..n | sap.ui.core.Control |
Association to controls / ids which describe this control (see WAI-ARIA attribute aria-describedby). |
ariaLabelledBy | 0..n | sap.ui.core.Control |
Association to controls / ids which label this control (see WAI-ARIA attribute aria-labelledby). |
Event | Description |
---|---|
press |
Fires when the user clicks/taps on active |
Method | Description |
---|---|
addAriaDescribedBy |
Adds some ariaDescribedBy into the association ariaDescribedBy. |
addAriaLabelledBy |
Adds some ariaLabelledBy into the association ariaLabelledBy. |
attachPress |
Attaches event handler When called, the context of the event handler (its Fires when the user clicks/taps on active |
detachPress |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.m.ObjectNumber.extend |
Creates a new subclass of class sap.m.ObjectNumber with name
|
firePress |
Fires event press to attached listeners. |
getAccessibilityInfo |
References:
|
getActive |
Gets current value of property active. Indicates if the Note: If you set this property to Default value is |
getAriaDescribedBy |
Returns array of IDs of the elements which are the current targets of the association ariaDescribedBy. |
getAriaLabelledBy |
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy. |
getEmphasized |
Gets current value of property emphasized. Indicates if the object number should appear emphasized. Default value is |
getEmptyIndicatorMode |
Gets current value of property emptyIndicatorMode. Specifies if an empty indicator should be displayed when there is no number. Default value is |
getInverted |
Gets current value of property inverted. Determines whether the background color reflects the set Default value is |
sap.m.ObjectNumber.getMetadata |
Returns a metadata object for class sap.m.ObjectNumber. |
getNumber |
Gets current value of property number. Defines the number field. |
getNumberUnit |
Gets current value of property numberUnit. Defines the number units qualifier.
Since 1.16.1 replaced by <code>unit</code> property
|
getState |
Gets current value of property state. Determines the object number's value state. Setting this state will cause the number to be rendered in state-specific colors. Default value is |
getTextAlign |
Gets current value of property textAlign. Sets the horizontal alignment of the number and unit. Default value is |
getTextDirection |
Gets current value of property textDirection. Available options for the number and unit text direction are LTR(left-to-right) and RTL(right-to-left). By default, the control inherits the text direction from its parent control. Default value is |
getUnit |
Gets current value of property unit. Defines the number units qualifier. If numberUnit and unit are both set, the unit value is used. |
removeAllAriaDescribedBy |
Removes all the controls in the association named ariaDescribedBy. |
removeAllAriaLabelledBy |
Removes all the controls in the association named ariaLabelledBy. |
removeAriaDescribedBy |
Removes an ariaDescribedBy from the association named ariaDescribedBy. |
removeAriaLabelledBy |
Removes an ariaLabelledBy from the association named ariaLabelledBy. |
setActive |
Sets a new value for property active. Indicates if the Note: If you set this property to When called with a value of Default value is |
setEmphasized |
Sets a new value for property emphasized. Indicates if the object number should appear emphasized. When called with a value of Default value is |
setEmptyIndicatorMode |
Sets a new value for property emptyIndicatorMode. Specifies if an empty indicator should be displayed when there is no number. When called with a value of Default value is |
setInverted |
Sets a new value for property inverted. Determines whether the background color reflects the set When called with a value of Default value is |
setNumber |
Sets a new value for property number. Defines the number field. When called with a value of |
setNumberUnit |
Sets a new value for property numberUnit. Defines the number units qualifier. When called with a value of
Since 1.16.1 replaced by <code>unit</code> property
|
setState |
Sets a new value for property state. Determines the object number's value state. Setting this state will cause the number to be rendered in state-specific colors. When called with a value of Default value is |
setTextAlign |
Sets a new value for property textAlign. Sets the horizontal alignment of the number and unit. When called with a value of Default value is |
setTextDirection |
Sets a new value for property textDirection. Available options for the number and unit text direction are LTR(left-to-right) and RTL(right-to-left). By default, the control inherits the text direction from its parent control. When called with a value of Default value is |
setUnit |
Sets a new value for property unit. Defines the number units qualifier. If numberUnit and unit are both set, the unit value is used. When called with a value of |
Adds some ariaDescribedBy into the association ariaDescribedBy.
Param | Type | DefaultValue | Description |
---|---|---|---|
vAriaDescribedBy | sap.ui.core.ID sap.ui.core.Control |
The ariaDescribedBy to add; if empty, nothing is inserted |
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.ObjectNumber
.
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.ObjectNumber
itself.
Fires when the user clicks/taps on active Object Number
.
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.ObjectNumber
.
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.ObjectNumber 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 |
Gets current value of property active.
Indicates if the ObjectNumber
text and icon can be clicked/tapped by the user.
Note: If you set this property to true
, you have to set also the number
or unit
property.
Default value is false
.
Returns array of IDs of the elements which are the current targets of the association ariaDescribedBy.
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Gets current value of property emphasized.
Indicates if the object number should appear emphasized.
Default value is true
.
Gets current value of property emptyIndicatorMode.
Specifies if an empty indicator should be displayed when there is no number.
Default value is Off
.
Gets current value of property inverted.
Determines whether the background color reflects the set state
instead of the control's text.
Default value is false
.
Gets current value of property numberUnit.
Defines the number units qualifier.
Gets current value of property state.
Determines the object number's value state. Setting this state will cause the number to be rendered in state-specific colors.
Default value is None
.
Gets current value of property textAlign.
Sets the horizontal alignment of the number and unit.
Default value is Begin
.
Gets current value of property textDirection.
Available options for the number and unit text direction are LTR(left-to-right) and RTL(right-to-left). By default, the control inherits the text direction from its parent control.
Default value is Inherit
.
Gets current value of property unit.
Defines the number units qualifier. If numberUnit and unit are both set, the unit value is used.
Removes an ariaDescribedBy from the association named ariaDescribedBy.
Param | Type | DefaultValue | Description |
---|---|---|---|
vAriaDescribedBy | int sap.ui.core.ID sap.ui.core.Control |
The ariaDescribedBy to be removed or its index or ID |
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 active.
Indicates if the ObjectNumber
text and icon can be clicked/tapped by the user.
Note: If you set this property to true
, you have to set also the number
or unit
property.
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 |
---|---|---|---|
bActive | boolean | false |
New value for property |
Sets a new value for property emphasized.
Indicates if the object number should appear emphasized.
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 |
---|---|---|---|
bEmphasized | boolean | true |
New value for property |
Sets a new value for property emptyIndicatorMode.
Specifies if an empty indicator should be displayed when there is no number.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Off
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sEmptyIndicatorMode | sap.m.EmptyIndicatorMode | Off |
New value for property |
Sets a new value for property inverted.
Determines whether the background color reflects the set state
instead of the control's text.
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 |
---|---|---|---|
bInverted | boolean | false |
New value for property |
Sets a new value for property number.
Defines the number field.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sNumber | string |
New value for property |
Sets a new value for property numberUnit.
Defines the number units qualifier.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sNumberUnit | string |
New value for property |
Sets a new value for property state.
Determines the object number's value state. Setting this state will cause the number to be rendered in state-specific colors.
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 |
---|---|---|---|
sState | sap.ui.core.ValueState | None |
New value for property |
Sets a new value for property textAlign.
Sets the horizontal alignment of the number and unit.
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 |
---|---|---|---|
sTextAlign | sap.ui.core.TextAlign | Begin |
New value for property |
Sets a new value for property textDirection.
Available options for the number and unit text direction are LTR(left-to-right) and RTL(right-to-left). 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 |
Sets a new value for property unit.
Defines the number units qualifier. If numberUnit and unit are both set, the unit value is used.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sUnit | string |
New value for property |