class sap.ui.commons.TextView

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

Is used to display some continous text. The control can inherit the text direction from its parent control.


Constructor

Constructor for a new TextView.

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.ui.commons.TextView(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
accessibleRole sap.ui.core.AccessibleRole

The ARIA role for the control.

Visibility: public
design sap.ui.commons.TextViewDesign Standard

Defines the visual appearance of the control.

Visibility: public
enabled boolean true

Switches the enabled state of the control. When the control is disabled, it is greyed out and no longer focusable.

Visibility: public
helpId string empty string

Unique identifier used for help services.

Visibility: public
semanticColor sap.ui.commons.TextViewColor Default

Semantic color of the text View

Visibility: public
text string empty string

Text to be displayed.

Visibility: public
textAlign sap.ui.core.TextAlign Begin

Sets the horizontal alignment of the text.

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

Determines the text directionality. Available options are LTR and RTL. Alternatively, the control can inherit the text direction from its parent control.

Visibility: public
width sap.ui.core.CSSSize

Width of the TextView

Visibility: public
wrapping boolean true

Disabled automatic wrapping of the text.

Visibility: public

Associations

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).


Methods Overview

Method Description
addAriaDescribedBy

Adds some ariaDescribedBy into the association ariaDescribedBy.

addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

bindText

Binds property text to model data.

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

sap.ui.commons.TextView.extend

Creates a new subclass of class sap.ui.commons.TextView 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.

getAccessibilityInfo

References:

  • sap.ui.core.Control#getAccessibilityInfo

getAccessibleRole

Gets current value of property accessibleRole.

The ARIA role for the control.

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.

getDesign

Gets current value of property design.

Defines the visual appearance of the control.

Default value is Standard.

getEnabled

Gets current value of property enabled.

Switches the enabled state of the control. When the control is disabled, it is greyed out and no longer focusable.

Default value is true.

getHelpId

Gets current value of property helpId.

Unique identifier used for help services.

Default value is empty string.

sap.ui.commons.TextView.getMetadata

Returns a metadata object for class sap.ui.commons.TextView.

getSemanticColor

Gets current value of property semanticColor.

Semantic color of the text View

Default value is Default.

getText

Gets current value of property text.

Text to be displayed.

Default value is empty string.

getTextAlign

Gets current value of property textAlign.

Sets the horizontal alignment of the text.

Default value is Begin.

getTextDirection

Gets current value of property textDirection.

Determines the text directionality. Available options are LTR and RTL. Alternatively, the control can inherit the text direction from its parent control.

Default value is Inherit.

getWidth

Gets current value of property width.

Width of the TextView

getWrapping

Gets current value of property wrapping.

Disabled automatic wrapping of the text.

Default value is true.

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.

setAccessibleRole

Sets a new value for property accessibleRole.

The ARIA role for the control.

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

setDesign

Sets a new value for property design.

Defines the visual appearance of the control.

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

Default value is Standard.

setEnabled

Sets a new value for property enabled.

Switches the enabled state of the control. When the control is disabled, it is greyed out and no longer focusable.

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

Default value is true.

setHelpId

Sets a new value for property helpId.

Unique identifier used for help services.

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

Default value is empty string.

setSemanticColor

Sets a new value for property semanticColor.

Semantic color of the text View

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

Default value is Default.

setText

Sets a new value for property text.

Text to be displayed.

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

Default value is empty string.

setTextAlign

Sets a new value for property textAlign.

Sets the horizontal alignment of the text.

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

Default value is Begin.

setTextDirection

Sets a new value for property textDirection.

Determines the text directionality. Available options are LTR and RTL. Alternatively, the control can inherit 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.

Width of the TextView

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

setWrapping

Sets a new value for property wrapping.

Disabled automatic wrapping of the text.

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

Default value is true.

unbindText

Unbinds property text from model data.

addAriaDescribedBy

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

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

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.ui.commons.TextView.extend

Creates a new subclass of class sap.ui.commons.TextView 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

getAccessibilityInfo

References:

getAccessibleRole

Gets current value of property accessibleRole.

The ARIA role for the control.

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.

getDesign

Gets current value of property design.

Defines the visual appearance of the control.

Default value is Standard.

getEnabled

Gets current value of property enabled.

Switches the enabled state of the control. When the control is disabled, it is greyed out and no longer focusable.

Default value is true.

getHelpId

Gets current value of property helpId.

Unique identifier used for help services.

Default value is empty string.

sap.ui.commons.TextView.getMetadata

Returns a metadata object for class sap.ui.commons.TextView.

getSemanticColor

Gets current value of property semanticColor.

Semantic color of the text View

Default value is Default.

getText

Gets current value of property text.

Text to be displayed.

Default value is empty string.

getTextAlign

Gets current value of property textAlign.

Sets the horizontal alignment of the text.

Default value is Begin.

getTextDirection

Gets current value of property textDirection.

Determines the text directionality. Available options are LTR and RTL. Alternatively, the control can inherit the text direction from its parent control.

Default value is Inherit.

getWidth

Gets current value of property width.

Width of the TextView

getWrapping

Gets current value of property wrapping.

Disabled automatic wrapping of the text.

Default value is true.

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.

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

The ariaDescribedBy to be removed or its index or ID

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

setAccessibleRole

Sets a new value for property accessibleRole.

The ARIA role for the control.

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

Param Type DefaultValue Description
sAccessibleRole sap.ui.core.AccessibleRole

New value for property accessibleRole

setDesign

Sets a new value for property design.

Defines the visual appearance of the control.

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

Default value is Standard.

Param Type DefaultValue Description
sDesign sap.ui.commons.TextViewDesign Standard

New value for property design

setEnabled

Sets a new value for property enabled.

Switches the enabled state of the control. When the control is disabled, it is greyed out and no longer focusable.

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

New value for property enabled

setHelpId

Sets a new value for property helpId.

Unique identifier used for help services.

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
sHelpId string ''

New value for property helpId

setSemanticColor

Sets a new value for property semanticColor.

Semantic color of the text View

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

Default value is Default.

Param Type DefaultValue Description
sSemanticColor sap.ui.commons.TextViewColor Default

New value for property semanticColor

setText

Sets a new value for property text.

Text to be displayed.

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

setTextAlign

Sets a new value for property textAlign.

Sets the horizontal alignment of the text.

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 textAlign

setTextDirection

Sets a new value for property textDirection.

Determines the text directionality. Available options are LTR and RTL. Alternatively, the control can inherit 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.

Width of the TextView

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

setWrapping

Sets a new value for property wrapping.

Disabled automatic wrapping of the text.

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

New value for property wrapping

unbindText

Unbinds property text from model data.