Class sap.m.TextModule: sap/m/Text
The Text control can be used for embedding longer text paragraphs, that need text wrapping, into your application.
sClassName
and enriches it with the information contained in oClassInfo
. Accepts an object literal mSettings
that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.
The supported settings are:
- Properties
In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.
{string} | sId? | ID for the new control, generated automatically if no ID is given |
{object} | mSettings? | Initial settings for the new control |
Default value is true.
- Since:
- 1.22
Can be overwritten with 3dots(...) if fonts do not support this UTF-8 character.
- Since:
- 1.13.2
This value is required during max-height calculation for the browsers that do not support line-clamping. It is better to define line-height in CSS instead of "normal" to get consistent maxLines results since normal line-height not only varies from browser to browser but they also vary from one font face to another and can also vary within a given face.
Default value is 1.2
- Since:
- 1.22
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.
{string} | sClassName | Name of the class being created |
{object} | oClassInfo? | Object literal with information about the class |
{function} | FNMetaImpl? | Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata |
{function} | Created class / constructor function |
{sap.ui.base.Metadata} | Metadata object describing this class |
{HTMLElement} | oDomRef | DOM reference of the text node container. |
{String} | sNodeValue? | new Node value. |
- Since:
- 1.30.3
text
to model data. See ManagedObject.bindProperty for a detailed description of the possible properties of oBindingInfo
{object} | oBindingInfo | The binding information |
{sap.m.Text} | Reference to this in order to allow method chaining |
{HTMLElement} | oDomRef? | DOM reference of the text container. |
- Since:
- 1.22
{Number} | calculated max height value |
Parameters can be used for better performance.
{HTMLElement} | oDomRef? | DOM reference of the text container. |
{number} | iStartPos? | Start point of the ellipsis search. |
{number} | iEndPos? | End point of the ellipsis search. |
- Since:
- 1.20
{number|undefined} | Returns found ellipsis position or undefined |
This is not calculated max-height!
{HTMLElement} | oDomRef? | DOM reference of the text container. |
- Since:
- 1.22
{Number} |
{HTMLElement} | oDomRef? | DOM reference of the text container. |
- Since:
- 1.22
{Number} | returns calculated line-height |
sap.m.Text#cacheLineHeight |
maxLines
. Limits the number of lines for wrapping texts.
Note: The multi-line overflow indicator depends on the browser line clamping support. For such browsers, this will be shown as ellipsis, for the other browsers the overflow will just be hidden.
- Since:
- 1.13.2
{int} | Value of property maxLines |
text
. Determines the text to be displayed.
Default value is .
{string} | Value of property text |
textAlign
. Sets the horizontal alignment of the text.
Default value is Begin
.
{sap.ui.core.TextAlign} | Value of property textAlign |
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
.
{sap.ui.core.TextDirection} | Value of property textDirection |
This can be different from getDomRef when inner wrapper is needed.
- Since:
- 1.22
{HTMLElement|null} |
width
. Sets the width of the Text control. By default, the Text control uses the full width available. Set this property to restrict the width to a custom value.
{sap.ui.core.CSSSize} | Value of property width |
wrapping
. Enables text wrapping.
Default value is true
.
{boolean} | Value of property wrapping |
- Since:
- 1.22
{HTMLElement|null} |
maxLines
. Limits the number of lines for wrapping texts.
Note: The multi-line overflow indicator depends on the browser line clamping support. For such browsers, this will be shown as ellipsis, for the other browsers the overflow will just be hidden.
When called with a value of null
or undefined
, the default value of the property will be restored.
{int} | iMaxLines | New value for property maxLines |
- Since:
- 1.13.2
{sap.m.Text} | Reference to this in order to allow method chaining |
text
. Determines the 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 .
{string} | sText | New value for property text |
{sap.m.Text} | Reference to this in order to allow method chaining |
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
.
{sap.ui.core.TextAlign} | sTextAlign | New value for property textAlign |
{sap.m.Text} | Reference to this in order to allow method chaining |
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
.
{sap.ui.core.TextDirection} | sTextDirection | New value for property textDirection |
{sap.m.Text} | Reference to this in order to allow method chaining |
width
. Sets the width of the Text control. By default, the Text control uses the full width available. 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.
{sap.ui.core.CSSSize} | sWidth | New value for property width |
{sap.m.Text} | Reference to this in order to allow method chaining |
wrapping
. Enables text wrapping.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
{boolean} | bWrapping | New value for property wrapping |
{sap.m.Text} | Reference to this in order to allow method chaining |
text
from model data. {sap.m.Text} | Reference to this in order to allow method chaining |