sap.m.InputBase.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.InputBase 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.m.InputBase.
Returns:
Adds some ariaLabelledBy into the association ariaLabelledBy
.
Parameters:
{string|sap.ui.core.Control} | vAriaLabelledBy | the ariaLabelledBy to add; if empty, nothing is inserted |
- Since:
- 1.27.0
Returns:
applyFocusInfo(oFocusInfo)
Applies the focus info. To be overwritten by subclasses.
Parameters:
Attaches event handler
fnFunction
to the
change
event of this
sap.m.InputBase
.
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.InputBase
itself.
Is fired when the text in the input field has changed and the focus leaves the input field 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.m.InputBase 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:
closeValueStateMessage()
Close value state message.
- Since:
- 1.26
Detaches event handler
fnFunction
from the
change
event of this
sap.m.InputBase
.
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:
value
of type string
The new value
of the control
.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
fireChangeEvent(sValue, oParams?)
Fires the change event for the listeners
Parameters:
{String} | sValue | value of the input. |
{Object} | oParams? | extra event parameters. |
- Since:
- 1.22.1
getAccessibilityInfo()
See:
{sap.ui.core.Control#getAccessibilityInfo} |
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy
.
- Since:
- 1.27.0
Returns:
getDomRefForValueStateMessage(): object
Get the reference element which the message popup should dock to.
- Since:
- 1.26
Returns:
{object} | DOM element which the message popup should dock to |
getEditable(): boolean
Gets current value of property
editable
.
Defines whether the control can be modified by the user or not. Note: A user can tab to non-editable control, highlight it, and copy the text from it.
Default value is true
.
- Since:
- 1.12.0
Returns:
{boolean} | Value of property editable |
getEnabled(): boolean
Gets current value of property
enabled
.
Indicates whether the user can interact with the control or not. Note: Disabled controls cannot be focused and they are out of the tab-chain.
Default value is true
.
Returns:
{boolean} | Value of property enabled |
getFocusInfo(): object
Returns an object representing the serialized focus information. To be overwritten by subclasses.
Returns:
{object} | An object representing the serialized focus information. |
getName(): string
Gets current value of property
name
.
Defines the name of the control for the purposes of form submission.
Returns:
{string} | Value of property name |
getPlaceholder(): string
Gets current value of property
placeholder
.
Defines a short hint intended to aid the user with data entry when the control has no value.
Returns:
{string} | Value of property placeholder |
getRequired(): boolean
Gets current value of property
required
.
Indicates that user input is required. This property is only needed for accessibility purposes when a single relationship between the field and a label (see aggregation labelFor
of sap.m.Label
) cannot be established (e.g. one label should label multiple fields).
Default value is false
.
- Since:
- 1.38.4
Returns:
{boolean} | Value of property required |
getSelectedText(): string
Retrieves the selected text. Only supported for input control's type of Text, Url, Tel and Password.
- Since:
- 1.32
Returns:
{string} | The selected text. |
getShowValueStateMessage(): boolean
Gets current value of property
showValueStateMessage
.
Indicates whether the value state message should be shown or not.
Default value is true
.
- Since:
- 1.26.0
Returns:
{boolean} | Value of property showValueStateMessage |
Gets current value of property
textAlign
.
Defines the horizontal alignment of the text that is shown inside the input field.
Default value is Initial
.
- Since:
- 1.26.0
Returns:
Gets current value of property
textDirection
.
Defines the text directionality of the input field, e.g. RTL
, LTR
Default value is Inherit
.
- Since:
- 1.28.0
Returns:
getValue(): string
Gets current value of property
value
.
Defines the value of the control.
Returns:
{string} | Value of property value |
Gets current value of property
valueState
.
Visualizes the validation state of the control, e.g. Error
, Warning
, Success
.
Default value is None
.
Returns:
getValueStateText(): string
Gets current value of property
valueStateText
.
Defines the text that appears in the value state message pop-up. If this is not specified, a default text is shown from the resource bundle.
- Since:
- 1.26.0
Returns:
{string} | Value of property valueStateText |
Gets current value of property
width
.
Defines the width of the control.
Returns:
onChange(oEvent): true|undefined
Handles the change event.
Parameters:
Returns:
{true|undefined} | true when change event is fired |
onValueRevertedByEscape(sValue)
Hook method that gets called when the input value is reverted with hitting escape. It may require to re-implement this method from sub classes for control specific behaviour.
Parameters:
{String} | sValue | Reverted value of the input. |
- Since:
- 1.26
openValueStateMessage()
Open value state message popup.
- Since:
- 1.26
Removes all the controls in the association named ariaLabelledBy
.
- Since:
- 1.27.0
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 |
- Since:
- 1.27.0
Returns:
Selects the text within the input field between the specified start and end positions. Only supported for input control's type of Text, Url, Tel and Password.
Parameters:
{int} | iSelectionStart | The index into the text at which the first selected character is located. |
{int} | iSelectionEnd | The index into the text at which the last selected character is located. |
- Since:
- 1.22.1
Returns:
Sets a new value for property
editable
.
Defines whether the control can be modified by the user or not. Note: A user can tab to non-editable control, highlight it, and copy the text from it.
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 |
- Since:
- 1.12.0
Returns:
Sets a new value for property
enabled
.
Indicates whether the user can interact with the control or not. Note: Disabled controls cannot be focused and they are out of the tab-chain.
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
name
.
Defines the name of the control for the purposes of form submission.
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
.
Defines a short hint intended to aid the user with data entry when the control has no value.
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 |
Returns:
Sets a new value for property
required
.
Indicates that user input is required. This property is only needed for accessibility purposes when a single relationship between the field and a label (see aggregation labelFor
of sap.m.Label
) cannot be established (e.g. one label should label multiple fields).
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 |
- Since:
- 1.38.4
Returns:
Sets a new value for property
showValueStateMessage
.
Indicates whether the value state message should be shown or not.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Parameters:
{boolean} | bShowValueStateMessage | New value for property showValueStateMessage |
- Since:
- 1.26.0
Returns:
Sets a new value for property
textAlign
.
Defines the horizontal alignment of the text that is shown inside the input field.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Initial
.
Parameters:
- Since:
- 1.26.0
Returns:
Sets a new value for property
textDirection
.
Defines the text directionality of the input field, e.g. 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:
- Since:
- 1.28.0
Returns:
Setter for property
value
.
Default value is empty/undefined
.
Parameters:
{string} | sValue | New value for property value . |
Returns:
Setter for property
valueState
.
Default value is None
.
Parameters:
Returns:
Setter for property
valueStateText
.
Default value is empty/undefined
.
Parameters:
{string} | sValueStateText | new value for property valueStateText |
- Since:
- 1.26
Returns:
Sets a new value for property
width
.
Defines the width of the control.
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:
Sets the DOM value of the input field and handles placeholder visibility.
Parameters:
{string} | sValue | value of the input field. |
- Since:
- 1.22
Returns:
Registers an event listener to the browser input event.
Parameters:
{function} | fnCallback | Function to be called when the value of the input element is changed. |
- Deprecated:
- Since 1.22. Instead, use event delegation(oninput) to listen input event.
Returns: