Class sap.m.TextAreaModule: sap/m/TextArea

extends InputBase

The sap.m.TextArea enables multi-line text input.


Since: 1.9.0.
Constructor Summary
new sap.m.TextArea(sId?, mSettings?)Constructor for a new TextArea.
Fields borrowed from class sap.m.InputBase
Event Summary
liveChange(oControlEvent)Is fired whenever the user has modified the text shown on the text area.
Events borrowed from class sap.m.InputBase
Events borrowed from class sap.ui.core.Control
Method Summary
sap.m.TextArea.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.TextArea with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.TextArea.getMetadata()Returns a metadata object for class sap.m.TextArea.
attachLiveChange(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the liveChange event of this sap.m.TextArea.
detachLiveChange(fnFunction, oListener)Detaches event handler fnFunction from the liveChange event of this sap.m.TextArea.
fireLiveChange(mArguments?)Fires event liveChange to attached listeners.
getCols()Gets current value of property cols.
getGrowing()Gets current value of property growing.
getGrowingMaxLines()Gets current value of property growingMaxLines.
getHeight()Gets current value of property height.
getMaxLength()Gets current value of property maxLength.
getRows()Gets current value of property rows.
getValue()Getter for property value.
getValueLiveUpdate()Gets current value of property valueLiveUpdate.
getWrapping()Gets current value of property wrapping.
setCols(iCols)Sets a new value for property cols.
setGrowing(bGrowing)Sets a new value for property growing.
setGrowingMaxLines(iGrowingMaxLines)Sets a new value for property growingMaxLines.
setHeight(sHeight)Sets a new value for property height.
setMaxLength(iMaxLength)Sets a new value for property maxLength.
setRows(iRows)Sets a new value for property rows.
setValueLiveUpdate(bValueLiveUpdate)Sets a new value for property valueLiveUpdate.
setWrapping(sWrapping)Sets a new value for property wrapping.
Constructor Detail
new sap.m.TextArea(sId?, mSettings?)
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 for a general description of the syntax of the settings object.

The supported settings are:

  • Properties
  • Events
    • liveChange : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

In addition, all settings applicable to the base type sap.m.InputBase can be used as well.

Parameters:
{string}sId? ID for the new control, generated automatically if no ID is given
{object}mSettings? Initial settings for the new control
Event Detail
liveChange(oControlEvent)
Is fired whenever the user has modified the text shown on the text area.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{string}oControlEvent.getParameters.value The new value of the control.
Method Detail
sap.m.TextArea.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.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.m.InputBase.extend.

Parameters:
{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
Returns:
{function} Created class / constructor function
sap.m.TextArea.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.TextArea.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
attachLiveChange(oData?, fnFunction, oListener?): sap.m.TextArea
Attaches event handler fnFunction to the liveChange event of this sap.m.TextArea.

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.TextArea itself.

Is fired whenever the user has modified the text shown on the text area.

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.m.TextArea itself
Returns:
{sap.m.TextArea} Reference to this in order to allow method chaining
detachLiveChange(fnFunction, oListener): sap.m.TextArea
Detaches event handler fnFunction from the liveChange event of this sap.m.TextArea.

The passed function and listener object must match the ones used for event registration.

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.m.TextArea} Reference to this in order to allow method chaining
fireLiveChange(mArguments?): sap.m.TextArea
Fires event liveChange to attached listeners.

Expects the following event parameters:

  • value of type stringThe new value of the control.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.TextArea} Reference to this in order to allow method chaining
getCols(): int
Gets current value of property cols.

Defines the visible width of the control, in average character widths. Note: The width property wins over the cols property, if both are set.

Default value is 20.

Returns:
{int} Value of property cols
getGrowing(): boolean
Gets current value of property growing.

Indicates the ability of the control to automatically grow and shrink dynamically with its content. Note: The height property is ignored, if this property set to true.

Default value is false.

Since:
1.38.0
Returns:
{boolean} Value of property growing
getGrowingMaxLines(): int
Gets current value of property growingMaxLines.

Defines the maximum number of lines that the control can grow.

Default value is 0.

Since:
1.38.0
Returns:
{int} Value of property growingMaxLines
getHeight(): sap.ui.core.CSSSize
Gets current value of property height.

Defines the height of the control.

Returns:
{sap.ui.core.CSSSize} Value of property height
getMaxLength(): int
Gets current value of property maxLength.

Defines the maximum number of characters that the value can be.

Default value is 0.

Returns:
{int} Value of property maxLength
getRows(): int
Gets current value of property rows.

Defines the number of visible text lines for the control. Note: The height property wins over the rows property, if both are set.

Default value is 2.

Returns:
{int} Value of property rows
getValue(): string
Getter for property value. Defines the value of the control's input field.

Default value is undefined

Returns:
{string} the value of property value
getValueLiveUpdate(): boolean
Gets current value of property valueLiveUpdate.

Indicates when the value property gets updated with the user changes. Setting it to true updates the value property whenever the user has modified the text shown on the text area.

Default value is false.

Since:
1.30
Returns:
{boolean} Value of property valueLiveUpdate
getWrapping(): sap.ui.core.Wrapping
Gets current value of property wrapping.

Indicates how the control wraps the text, e.g. Soft, Hard, Off.

Default value is None.

Returns:
{sap.ui.core.Wrapping} Value of property wrapping
setCols(iCols): sap.m.TextArea
Sets a new value for property cols.

Defines the visible width of the control, in average character widths. Note: The width property wins over the cols property, if both are set.

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

Default value is 20.

Parameters:
{int}iCols New value for property cols
Returns:
{sap.m.TextArea} Reference to this in order to allow method chaining
setGrowing(bGrowing): sap.m.TextArea
Sets a new value for property growing.

Indicates the ability of the control to automatically grow and shrink dynamically with its content. Note: The height property is ignored, if this property set to true.

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

Default value is false.

Parameters:
{boolean}bGrowing New value for property growing
Since:
1.38.0
Returns:
{sap.m.TextArea} Reference to this in order to allow method chaining
setGrowingMaxLines(iGrowingMaxLines): sap.m.TextArea
Sets a new value for property growingMaxLines.

Defines the maximum number of lines that the control can grow.

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

Default value is 0.

Parameters:
{int}iGrowingMaxLines New value for property growingMaxLines
Since:
1.38.0
Returns:
{sap.m.TextArea} Reference to this in order to allow method chaining
setHeight(sHeight): sap.m.TextArea
Sets a new value for property height.

Defines the height of the control.

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

Parameters:
{sap.ui.core.CSSSize}sHeight New value for property height
Returns:
{sap.m.TextArea} Reference to this in order to allow method chaining
setMaxLength(iMaxLength): sap.m.TextArea
Sets a new value for property maxLength.

Defines the maximum number of characters that the value can be.

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

Default value is 0.

Parameters:
{int}iMaxLength New value for property maxLength
Returns:
{sap.m.TextArea} Reference to this in order to allow method chaining
setRows(iRows): sap.m.TextArea
Sets a new value for property rows.

Defines the number of visible text lines for the control. Note: The height property wins over the rows property, if both are set.

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

Default value is 2.

Parameters:
{int}iRows New value for property rows
Returns:
{sap.m.TextArea} Reference to this in order to allow method chaining
setValueLiveUpdate(bValueLiveUpdate): sap.m.TextArea
Sets a new value for property valueLiveUpdate.

Indicates when the value property gets updated with the user changes. Setting it to true updates the value property whenever the user has modified the text shown on the text area.

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

Default value is false.

Parameters:
{boolean}bValueLiveUpdate New value for property valueLiveUpdate
Since:
1.30
Returns:
{sap.m.TextArea} Reference to this in order to allow method chaining
setWrapping(sWrapping): sap.m.TextArea
Sets a new value for property wrapping.

Indicates how the control wraps the text, e.g. Soft, Hard, Off.

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

Default value is None.

Parameters:
{sap.ui.core.Wrapping}sWrapping New value for property wrapping
Returns:
{sap.m.TextArea} Reference to this in order to allow method chaining