class sap.ui.commons.TextArea

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

Control to enter or display multible row text.


Constructor

Constructor for a new TextArea.

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.TextArea(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
cols int

Number of Columns. Cols means number of characters per row. This proprty is only used if Width is not used.

Visibility: public
cursorPos int

Position of cursor, e.g., to let the user re-start typing at the same position as before the server roundtrip

Visibility: public
explanation string

text which appears, in case quick-help is switched on

Visibility: public
height sap.ui.core.CSSSize

Height of text field. When it is set (CSS-size such as % or px), this is the exact size.

Visibility: public
labeledBy string

ID of label control

Visibility: public
rows int

Number of Rows. This proprty is only used if Height is not used.

Visibility: public
wrapping sap.ui.core.Wrapping

Text wrapping. Possible values are: Soft, Hard, Off.

Visibility: public

Borrowed Properties

Name Type Default Value Description
accessibleRole sap.ui.core.AccessibleRole Textbox

Accessibility role for the text field.

Visibility: public
design sap.ui.core.Design Standard

Font type. valid values are Standard and Monospace.

Visibility: public
editable boolean true

Switches edit state of the control. Read-only fields have different colors, depending on theme setting.

Visibility: public
enabled boolean true

Switches enabled state of the control. Disabled fields have different colors, and can not be focused.

Visibility: public
helpId string empty string

Unique identifier used for help service.

Visibility: public
imeMode sap.ui.core.ImeMode Auto

State of the Input Method Editor (IME).

Visibility: public
maxLength int 0

Maximum number of characters. Value '0' means the feature is switched off.

Visibility: public
name string

The name property to be used in the HTML code (e.g. for HTML forms that send data to the server via 'submit').

Visibility: public
placeholder string

Placeholder for the text field.

Since: 1.14.0.

Visibility: public
required boolean false

Depending on theme the TextField is shown as required. If a Label is assigned to the TextField it will visualize the requires state too.

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

Sets the horizontal alignment of the text.

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

Direction of the text. Possible values: "rtl", "ltr".

Visibility: public
value string empty string

Text inside the TextField

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

Visualizes warnings or errors related to the text field. Possible values: Warning, Error, Success.

Visibility: public
width sap.ui.core.CSSSize

Width of text field. When it is set (CSS-size such as % or px), this is the exact size. When left blank, the text field length defines the width.

Visibility: public

Methods Overview

Method Description
sap.ui.commons.TextArea.extend

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

getCols

Gets current value of property cols.

Number of Columns. Cols means number of characters per row. This proprty is only used if Width is not used.

getCursorPos

Gets current value of property cursorPos.

Position of cursor, e.g., to let the user re-start typing at the same position as before the server roundtrip

getExplanation

Gets current value of property explanation.

text which appears, in case quick-help is switched on

getHeight

Gets current value of property height.

Height of text field. When it is set (CSS-size such as % or px), this is the exact size.

getLabeledBy

Gets current value of property labeledBy.

ID of label control

Since 1.5.2 Please use association AriaLabelledBy instead.
sap.ui.commons.TextArea.getMetadata

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

getRows

Gets current value of property rows.

Number of Rows. This proprty is only used if Height is not used.

getWrapping

Gets current value of property wrapping.

Text wrapping. Possible values are: Soft, Hard, Off.

setCols

Sets a new value for property cols.

Number of Columns. Cols means number of characters per row. This proprty is only used if Width is not used.

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

setCursorPos

Property setter for the cursor position

setExplanation

Sets a new value for property explanation.

text which appears, in case quick-help is switched on

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

setHeight

Sets a new value for property height.

Height of text field. When it is set (CSS-size such as % or px), this is the exact size.

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

setLabeledBy

Sets a new value for property labeledBy.

ID of label control

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

Since 1.5.2 Please use association AriaLabelledBy instead.
setMaxLength

Property setter for MaxLength

setRows

Sets a new value for property rows.

Number of Rows. This proprty is only used if Height is not used.

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.

Text wrapping. Possible values are: Soft, Hard, Off.

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

sap.ui.commons.TextArea.extend

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

getCols

Gets current value of property cols.

Number of Columns. Cols means number of characters per row. This proprty is only used if Width is not used.

getCursorPos

Gets current value of property cursorPos.

Position of cursor, e.g., to let the user re-start typing at the same position as before the server roundtrip

getExplanation

Gets current value of property explanation.

text which appears, in case quick-help is switched on

getHeight

Gets current value of property height.

Height of text field. When it is set (CSS-size such as % or px), this is the exact size.

getLabeledBy

Gets current value of property labeledBy.

ID of label control

Since 1.5.2 Please use association AriaLabelledBy instead.

sap.ui.commons.TextArea.getMetadata

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

getRows

Gets current value of property rows.

Number of Rows. This proprty is only used if Height is not used.

getWrapping

Gets current value of property wrapping.

Text wrapping. Possible values are: Soft, Hard, Off.

setCols

Sets a new value for property cols.

Number of Columns. Cols means number of characters per row. This proprty is only used if Width is not used.

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

Param Type DefaultValue Description
iCols int

New value for property cols

setCursorPos

Property setter for the cursor position

Param Type DefaultValue Description
iCursorPos int

cursor position

setExplanation

Sets a new value for property explanation.

text which appears, in case quick-help is switched on

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

Param Type DefaultValue Description
sExplanation string

New value for property explanation

setHeight

Sets a new value for property height.

Height of text field. When it is set (CSS-size such as % or px), this is the exact size.

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

Param Type DefaultValue Description
sHeight sap.ui.core.CSSSize

New value for property height

setLabeledBy

Sets a new value for property labeledBy.

ID of label control

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

Since 1.5.2 Please use association AriaLabelledBy instead.
Param Type DefaultValue Description
sLabeledBy string

New value for property labeledBy

setMaxLength

Property setter for MaxLength

Param Type DefaultValue Description
iMaxLength int

maximal length of text

setRows

Sets a new value for property rows.

Number of Rows. This proprty is only used if Height is not used.

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

Param Type DefaultValue Description
iRows int

New value for property rows

setWrapping

Sets a new value for property wrapping.

Text wrapping. Possible values are: Soft, Hard, Off.

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

Param Type DefaultValue Description
sWrapping sap.ui.core.Wrapping

New value for property wrapping