sap.ui.commons.TextField.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.commons.TextField 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.
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 |
Returns a metadata object for class sap.ui.commons.TextField.
Returns:
_checkChange(oEvent)
Compares the previous value with the current value and fires the change event if the TextField is editable and the value has changed.
Parameters:
Adds some ariaDescribedBy into the association ariaDescribedBy
.
Parameters:
{string|sap.ui.core.Control} | vAriaDescribedBy | the ariaDescribedBy to add; if empty, nothing is inserted |
Returns:
Adds some ariaLabelledBy into the association ariaLabelledBy
.
Parameters:
{string|sap.ui.core.Control} | vAriaLabelledBy | the ariaLabelledBy to add; if empty, nothing is inserted |
Returns:
Attaches event handler
fnFunction
to the
change
event of this
sap.ui.commons.TextField
.
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.ui.commons.TextField
itself.
Event is fired when the text in the field has changed AND the focus leaves the TextField or the Enter key is pressed.
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.ui.commons.TextField itself |
Returns:
Attaches event handler
fnFunction
to the
liveChange
event of this
sap.ui.commons.TextField
.
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.ui.commons.TextField
itself.
This event if fired during typing into the TextField
and returns the currently entered value. Note: This is not the content of the value property. The value property is only updated by ENTER and by leaving the control.
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.ui.commons.TextField itself |
Returns:
Binds property
value
to model data.
See ManagedObject.bindProperty for a detailed description of the possible properties of oBindingInfo
Parameters:
{object} | oBindingInfo | The binding information |
Returns:
Detaches event handler
fnFunction
from the
change
event of this
sap.ui.commons.TextField
.
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:
Detaches event handler
fnFunction
from the
liveChange
event of this
sap.ui.commons.TextField
.
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:
Fires event
change
to attached listeners.
Expects the following event parameters:
newValue
of type string
The new / changed value of the TextField
.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
Fires event
liveChange
to attached listeners.
Expects the following event parameters:
liveValue
of type string
Current visible value of the TextField
.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
getAccessibilityInfo()
See:
{sap.ui.core.Control#getAccessibilityInfo} |
Gets current value of property
accessibleRole
.
Accessibility role for the text field.
Default value is Textbox
.
Returns:
Returns array of IDs of the elements which are the current targets of the association ariaDescribedBy
.
Returns:
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy
.
Returns:
Gets current value of property
design
.
Font type. valid values are Standard and Monospace.
Default value is Standard
.
Returns:
getEditable(): boolean
Gets current value of property
editable
.
Switches edit state of the control. Read-only fields have different colors, depending on theme setting.
Default value is true
.
Returns:
{boolean} | Value of property editable |
getEnabled(): boolean
Gets current value of property
enabled
.
Switches enabled state of the control. Disabled fields have different colors, and can not be focused.
Default value is true
.
Returns:
{boolean} | Value of property enabled |
getFocusInfo(): object
Returns an object representing the serialized focus information
Returns:
{object} | an object representing the serialized focus information |
getHelpId(): string
Gets current value of property
helpId
.
Unique identifier used for help service.
Default value is
.
Returns:
{string} | Value of property helpId |
Gets current value of property
imeMode
.
State of the Input Method Editor (IME).
Default value is Auto
.
Returns:
getInputDomRef(): object
Method for accessing the DOM Ref of the input element.
Returns:
{object} | DOM reference or null |
getLiveValue(): string
Returns the current value of the TextField
. In case of editing the TextField
you can access the current value via this method. The validated value is accessible via the property value.
Returns:
getMaxLength(): int
Gets current value of property
maxLength
.
Maximum number of characters. Value '0' means the feature is switched off.
Default value is 0
.
Returns:
{int} | Value of property maxLength |
getName(): string
Gets current value of property
name
.
The name
property to be used in the HTML code (e.g. for HTML forms that send data to the server via 'submit').
Returns:
{string} | Value of property name |
getPlaceholder(): string
Gets current value of property
placeholder
.
Placeholder for the text field.
- Since:
- 1.14.0
Returns:
{string} | Value of property placeholder |
getRequired(): boolean
Gets current value of property
required
.
Depending on theme the TextField
is shown as required. If a Label
is assigned to the TextField
it will visualize the requires state too.
Default value is false
.
Returns:
{boolean} | Value of property required |
Gets current value of property
textAlign
.
Sets the horizontal alignment of the text.
Default value is Begin
.
Returns:
Gets current value of property
textDirection
.
Direction of the text. Possible values: "rtl", "ltr".
Default value is Inherit
.
Returns:
getValue(): string
Gets current value of property
value
.
Text inside the TextField
Default value is
.
Returns:
{string} | Value of property value |
Gets current value of property
valueState
.
Visualizes warnings or errors related to the text field. Possible values: Warning, Error, Success.
Default value is None
.
Returns:
Gets current value of property
width
.
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.
Returns:
onfocusin(oEvent)
Event handler called when control is receiving the focus
Parameters:
onkeyup(oEvent)
Event handler for keyup. fire the liveChange event
Parameters:
onsapenter(oEvent)
Event handler called when enter key is pressed.
Parameters:
See:
sap.ui.commons.TextField#onfocusout |
onsapfocusleave(oEvent)
Event handler called when control is losing the focus
Parameters:
onselectstart(oEvent)
Event handler called when text selection starts. When the text field is disabled, the text should not be selectable, so cancel the event.
Parameters:
Removes all the controls in the association named ariaDescribedBy
.
Returns:
Removes all the controls in the association named ariaLabelledBy
.
Returns:
Removes an ariaDescribedBy from the association named ariaDescribedBy
.
Parameters:
{int|string|sap.ui.core.Control} | vAriaDescribedBy | The ariaDescribedByto be removed or its index or ID |
Returns:
Removes an ariaLabelledBy from the association named ariaLabelledBy
.
Parameters:
{int|string|sap.ui.core.Control} | vAriaLabelledBy | The ariaLabelledByto be removed or its index or ID |
Returns:
Sets a new value for property
accessibleRole
.
Accessibility role for the text field.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Textbox
.
Parameters:
Returns:
Sets a new value for property
design
.
Font type. valid values are Standard and Monospace.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Standard
.
Parameters:
Returns:
Sets a new value for property
editable
.
Switches edit state of the control. Read-only fields have different colors, depending on theme setting.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Parameters:
{boolean} | bEditable | New value for property editable |
Returns:
Sets a new value for property
enabled
.
Switches enabled state of the control. Disabled fields have different colors, and can not be focused.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Parameters:
{boolean} | bEnabled | New value for property enabled |
Returns:
Sets a new value for property
helpId
.
Unique identifier used for help service.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is
.
Parameters:
{string} | sHelpId | New value for property helpId |
Returns:
Sets a new value for property
imeMode
.
State of the Input Method Editor (IME).
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Auto
.
Parameters:
Returns:
Sets a new value for property
maxLength
.
Maximum number of characters. Value '0' means the feature is switched off.
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:
Sets a new value for property
name
.
The name
property to be used in the HTML code (e.g. for HTML forms that send data to the server via 'submit').
When called with a value of null
or undefined
, the default value of the property will be restored.
Parameters:
{string} | sName | New value for property name |
Returns:
Sets a new value for property
placeholder
.
Placeholder for the text field.
When called with a value of null
or undefined
, the default value of the property will be restored.
Parameters:
{string} | sPlaceholder | New value for property placeholder |
- Since:
- 1.14.0
Returns:
Sets a new value for property
required
.
Depending on theme the TextField
is shown as required. If a Label
is assigned to the TextField
it will visualize the requires state too.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Parameters:
{boolean} | bRequired | New value for property required |
Returns:
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
.
Parameters:
Returns:
Sets a new value for property
textDirection
.
Direction of the text. Possible values: "rtl", "ltr".
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Inherit
.
Parameters:
Returns:
Sets a new value for property
value
.
Text inside the TextField
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is
.
Parameters:
{string} | sValue | New value for property value |
Returns:
Sets a new value for property
valueState
.
Visualizes warnings or errors related to the text field. Possible values: Warning, Error, Success.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is None
.
Parameters:
Returns:
Sets a new value for property
width
.
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.
When called with a value of null
or undefined
, the default value of the property will be restored.
Parameters:
Returns:
Unbinds property value
from model data.
Returns: