class sap.m.Input

Control sample: sap.m.Input
Visiblity: public
UX Guidelines: Input
Implements:
Available since: N/A
Extends: sap.m.InputBase
Module: sap/m/Input
Application Component: CA-UI5-CTR

Allows the user to enter and edit text or numeric values in one line.

Overview

You can enable the autocomplete suggestion feature and the value help option to easily enter a valid value.

Guidelines

Structure

The controls inherits from sap.m.InputBase which controls the core properties like:

To aid the user during input, you can enable value help (showValueHelp) or autocomplete (showSuggestion). Value help will open a new dialog where you can refine your input. Autocomplete has three types of suggestions: The suggestions are stored in two aggregations suggestionItems (for single and double values) and suggestionRows (for tabular values).

Usage

When to use: Use the control for short inputs like emails, phones, passwords, fields for assisted value selection.

When not to use: Don't use the control for long texts, dates, designated search fields, fields for multiple selection.

Known Restrictions

If showValueHelp or if showSuggestion is true, the native browser autofill will not fire a change event.

Note:

The control has the following behavior regarding the selectedKey and value properties:


Constructor

Constructor for a new Input.

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.m.Input(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
autocomplete boolean true

Specifies whether autocomplete is enabled. Works only if "showSuggestion" property is set to true. Note: The autocomplete feature is disabled on Android devices due to a OS specific issue.

Since: 1.61.

Visibility: public
dateFormat string YYYY-MM-dd

Only used if type=date and no datepicker is available. The data is displayed and the user input is parsed according to this format. Note: The value property is always of the form RFC 3339 (YYYY-MM-dd).

Visibility: public
description string

The description is a text after the input field, e.g. units of measurement, currencies.

Visibility: public
effectiveShowClearIcon boolean false

Specifies whether the clear icon should be shown/hidden on user interaction.

Visibility: hidden
enableSuggestionsHighlighting boolean true

Specifies whether the suggestions highlighting is enabled.

Since: 1.46.

Visibility: public
enableTableAutoPopinMode boolean false

Enables the autoPopinMode of sap.m.Table, when the input has tabular suggestions. Note: The autoPopinMode overwrites the demandPopin and the minScreenWidth properties of the sap.m.Column. When setting, enableTableAutoPopinMode, from true to false, the application must reconfigure the demandPopin and minScreenWidth properties of the sap.m.Column control by itself.

Since: 1.89.

Visibility: public
fieldWidth sap.ui.core.CSSSize 50%

This property only takes effect if the description property is set. It controls the distribution of space between the input field and the description text. The default value is 50% leaving the other 50% for the description.

Visibility: public
filterSuggests boolean true

Defines whether to filter the provided suggestions before showing them to the user.

Visibility: public
maxLength int 0

Maximum number of characters. Value '0' means the feature is switched off. This parameter is not compatible with the input type sap.m.InputType.Number. If the input type is set to Number, the maxLength value is ignored.

Visibility: public
maxSuggestionWidth sap.ui.core.CSSSize

If set, the value of this parameter will control the horizontal size of the suggestion list to display more data. This allows suggestion lists to be wider than the input field if there is enough space available. By default, the suggestion list is always as wide as the input field. Note: The value will be ignored if the actual width of the input field is larger than the specified parameter value.

Since: 1.21.1.

Visibility: public
selectedKey string empty string

Defines the key of the selected item.

Note: If duplicate keys exist, the first item matching the key is used.

Since: 1.44.

Visibility: public
showClearIcon boolean false

Specifies whether clear icon is shown. Pressing the icon will clear input's value and fire the change and liveChange events.

Since: 1.94.

Visibility: public
showSuggestion boolean false

If this is set to true, suggest event is fired when user types in the input. Changing the suggestItems aggregation in suggest event listener will show suggestions within a popup. When runs on phone, input will first open a dialog where the input and suggestions are shown. When runs on a tablet, the suggestions are shown in a popup next to the input.

Since: 1.16.1.

Visibility: public
showTableSuggestionValueHelp boolean true

For tabular suggestions, this flag will show/hide the button at the end of the suggestion table that triggers the event "valueHelpRequest" when pressed. The default value is true.

Note: If suggestions are not tabular or no suggestions are used, the button will not be displayed and this flag is without effect.

Since: 1.22.1.

Visibility: public
showValueHelp boolean false

If set to true, a value help indicator will be displayed inside the control. When clicked the event "valueHelpRequest" will be fired.

Since: 1.16.

Visibility: public
startSuggestion int 1

Minimum length of the entered text in input before suggest event is fired. The default value is 1 which means the suggest event is fired after user types in input.

Note: When it's set to 0, suggest event is fired when input with no text gets focus. In this case no suggestion popup will open.

Since: 1.21.2.

Visibility: public
suggestionRowValidator any empty string

Defines the validation callback function called when a suggestion row gets selected.

Since: 1.44.

Visibility: public
textFormatMode sap.m.InputTextFormatMode Value

Defines the display text format mode.

Since: 1.44.

Visibility: public
textFormatter any empty string

Defines the display text formatter function.

Since: 1.44.

Visibility: public
type sap.m.InputType Text

HTML type of the internal input tag (e.g. Text, Number, Email, Phone). The particular effect of this property differs depending on the browser and the current language settings, especially for the type Number.
This parameter is intended to be used with touch devices that use different soft keyboard layouts depending on the given input type.
Only the default value sap.m.InputType.Text may be used in combination with data model formats. sap.ui.model defines extended formats that are mostly incompatible with normal HTML representations for numbers and dates.

Visibility: public
valueHelpIconSrc sap.ui.core.URI sap-icon://value-help

Set custom value help icon.

Since: 1.84.0.

Visibility: public
valueHelpOnly boolean false

If set to true, direct text input is disabled and the control will trigger the event "valueHelpRequest" for all user interactions. The properties "showValueHelp", "editable", and "enabled" must be set to true, otherwise the property will have no effect

Since: 1.21.0.

Visibility: public
valueLiveUpdate boolean false

Indicates when the value gets updated with the user changes: At each keystroke (true) or first when the user presses enter or tabs out (false).

Note: When set to true and the value of the Input control is bound to a model, the change event becomes obsolete and will not be fired, as the value in the model will be updated each time the user provides input. In such cases, subscription to the liveChange event is more appropriate, as it corresponds to the way the underlying model gets updated.

Since: 1.24.

Visibility: public

Borrowed Properties

Name Type Default Value Description
editable boolean true

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.

Since: 1.12.0.

Visibility: public
enabled boolean true

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.

Visibility: public
name string

The name to be used in the HTML code (for example, for HTML forms that send data to the server via submission).

Visibility: public
placeholder string

Defines a short hint intended to aid the user with data entry when the control has no value.

Visibility: public
required boolean false

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).

Since: 1.38.4.

Visibility: public
showValueStateMessage boolean true

Indicates whether the value state message should be shown or not.

Since: 1.26.0.

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

Defines the horizontal alignment of the text that is shown inside the input field.

Since: 1.26.0.

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

Defines the text directionality of the input field, e.g. RTL, LTR

Since: 1.28.0.

Visibility: public
value string

Defines the value of the control.

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

Visualizes the validation state of the control, e.g. Error, Warning, Success.

Visibility: public
valueStateText string

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.

Visibility: public
width sap.ui.core.CSSSize

Defines the width of the control.

Note: If the provided width is too small, the control gets stretched to its min width, which is needed in order for the control to be usable and well aligned.

Visibility: public

Aggregations

Default Aggregation: suggestionItems

Name Cardinality Type Description
_suggestionPopup 0..1 sap.ui.core.Control

The suggestion popup (can be a Dialog or Popover); aggregation needed to also propagate the model and bindings to the content of the popover

_valueHelpIcon 0..1 sap.ui.core.Icon

The icon on the right side of the Input

suggestionColumns 0..n sap.m.Column

The suggestionColumns and suggestionRows are for tabular input suggestions. This aggregation allows for binding the table columns; for more details see the aggregation "suggestionRows".

Since: 1.21.1.

suggestionItems (default) 0..n sap.ui.core.Item

Defines the items displayed in the suggestion popup. Changing this aggregation (by calling addSuggestionItem, insertSuggestionItem, removeSuggestionItem, removeAllSuggestionItems, or destroySuggestionItems) after Input is rendered opens/closes the suggestion popup.

To display suggestions with two text values, add sap.ui.core.ListItem as SuggestionItems (since 1.21.1). For the selected ListItem, only the first value is returned to the input field.

Note: Only text and additionalText property values of the item are displayed. For example, if an icon is set, it is ignored. To display more information per item (including icons), you can use the suggestionRows aggregation.

Note: Disabled items are not visualized in the list with the suggestions, however they can still be accessed through the aggregation. Note: If suggestionItems & suggestionRows are set in parallel, the last aggeragtion to come would overwrite the previous ones.

Since: 1.16.1.

suggestionRows 0..n sap.m.ColumnListItem

The suggestionColumns and suggestionRows are for tabular input suggestions. This aggregation allows for binding the table cells. The items of this aggregation are to be bound directly or to set in the suggest event method. Note: If suggestionItems & suggestionRows are set in parallel, the last aggeragtion to come would overwrite the previous ones.

Since: 1.21.1.

Borrowed Aggregations

Name Cardinality Type Description
formattedValueStateText 0..1 sap.m.FormattedText

Defines the formatted text that appears in the value state message pop-up. It can include links. If both valueStateText and formattedValueStateText are set - the latter is shown.

Since: 1.78.


Associations

Name Cardinality Type Description
selectedItem 0..1 sap.ui.core.Item

Sets or retrieves the selected item from the suggestionItems.

Since: 1.44.

selectedRow 0..1 sap.m.ColumnListItem

Sets or retrieves the selected row from the suggestionRows.

Since: 1.44.


Events Overview

Event Description
liveChange

Fired when the value of the input is changed by user interaction - each keystroke, delete, paste, etc.

Note: Browsing autocomplete suggestions does not fires the event.

submit

This event is fired when user presses the Enter key on the input.

Notes:

  • The event is fired independent of whether there was a change before or not. If a change was performed, the event is fired after the change event.
  • The event is also fired when an item of the select list is selected via Enter.
  • The event is only fired on an input which allows text input (editable, enabled and not valueHelpOnly).


Since: 1.33.0.

suggest

This event is fired when user types in the input and showSuggestion is set to true. Changing the suggestItems aggregation will show the suggestions within a popup.

Since: 1.16.1.

suggestionItemSelected

This event is fired when suggestionItem shown in suggestion popup are selected. This event is only fired when showSuggestion is set to true and there are suggestionItems shown in the suggestion popup.

Since: 1.16.3.

valueHelpRequest

When the value help indicator is clicked, this event will be fired.

Since: 1.16.

liveChange

Fired when the value of the input is changed by user interaction - each keystroke, delete, paste, etc.

Note: Browsing autocomplete suggestions does not fires the event.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
value string

The current value of the input, after a live change event.

escPressed boolean

Indicates that ESC key triggered the event. Note: This parameter will not be sent unless the ESC key is pressed.

Since: 1.48.

previousValue string

The value of the input before pressing ESC key. Note: This parameter will not be sent unless the ESC key is pressed.

Since: 1.48.

submit

This event is fired when user presses the Enter key on the input.

Notes:



Since: 1.33.0.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
value string

The new value of the input.

suggest

This event is fired when user types in the input and showSuggestion is set to true. Changing the suggestItems aggregation will show the suggestions within a popup.

Since: 1.16.1.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
suggestValue string

The current value which has been typed in the input.

suggestionColumns sap.m.ListBase

The suggestion list is passed to this event for convenience. If you use list-based or tabular suggestions, fill the suggestionList with the items you want to suggest. Otherwise, directly add the suggestions to the "suggestionItems" aggregation of the input control.

suggestionItemSelected

This event is fired when suggestionItem shown in suggestion popup are selected. This event is only fired when showSuggestion is set to true and there are suggestionItems shown in the suggestion popup.

Since: 1.16.3.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
selectedItem sap.ui.core.Item

This is the item selected in the suggestion popup for one and two-value suggestions. For tabular suggestions, this value will not be set.

selectedRow sap.m.ColumnListItem

This is the row selected in the tabular suggestion popup represented as a ColumnListItem. For one and two-value suggestions, this value will not be set.

Note: The row result function to select a result value for the string is already executed at this time. To pick different value for the input field or to do follow up steps after the item has been selected.

Since: 1.21.1.

valueHelpRequest

When the value help indicator is clicked, this event will be fired.

Since: 1.16.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
fromSuggestions boolean

The event parameter is set to true, when the button at the end of the suggestion table is clicked, otherwise false. It can be used to determine whether the "value help" trigger or the "show all items" trigger has been pressed.


Methods Overview

Method Description
_decoratePopupInput

Modifies Dialog's Input instance

addSuggestionColumn

Adds some suggestionColumn to the aggregation suggestionColumns.

addSuggestionItem

Adds suggestion item.

addSuggestionRow

Adds some suggestionRow to the aggregation suggestionRows.

attachLiveChange

Attaches event handler fnFunction to the liveChange event of this sap.m.Input.

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

Fired when the value of the input is changed by user interaction - each keystroke, delete, paste, etc.

Note: Browsing autocomplete suggestions does not fires the event.

attachSubmit

Attaches event handler fnFunction to the submit event of this sap.m.Input.

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

This event is fired when user presses the Enter key on the input.

Notes:

  • The event is fired independent of whether there was a change before or not. If a change was performed, the event is fired after the change event.
  • The event is also fired when an item of the select list is selected via Enter.
  • The event is only fired on an input which allows text input (editable, enabled and not valueHelpOnly).

attachSuggest

Attaches event handler fnFunction to the suggest event of this sap.m.Input.

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

This event is fired when user types in the input and showSuggestion is set to true. Changing the suggestItems aggregation will show the suggestions within a popup.

attachSuggestionItemSelected

Attaches event handler fnFunction to the suggestionItemSelected event of this sap.m.Input.

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

This event is fired when suggestionItem shown in suggestion popup are selected. This event is only fired when showSuggestion is set to true and there are suggestionItems shown in the suggestion popup.

attachValueHelpRequest

Attaches event handler fnFunction to the valueHelpRequest event of this sap.m.Input.

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

When the value help indicator is clicked, this event will be fired.

bindSuggestionColumns

Binds aggregation suggestionColumns to model data.

See ManagedObject.bindAggregation for a detailed description of the possible properties of oBindingInfo.

bindSuggestionRows

Binds aggregation suggestionRows to model data.

See ManagedObject.bindAggregation for a detailed description of the possible properties of oBindingInfo.

cancelPendingSuggest

Cancels any pending suggestions.

clone

Clones input.

closeSuggestions

Closes the suggestion list.

destroySuggestionColumns

Destroys all the suggestionColumns in the aggregation suggestionColumns.

destroySuggestionItems

Destroys suggestion items.

destroySuggestionRows

Destroys all the suggestionRows in the aggregation suggestionRows.

detachLiveChange

Detaches event handler fnFunction from the liveChange event of this sap.m.Input.

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

detachSubmit

Detaches event handler fnFunction from the submit event of this sap.m.Input.

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

detachSuggest

Detaches event handler fnFunction from the suggest event of this sap.m.Input.

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

detachSuggestionItemSelected

Detaches event handler fnFunction from the suggestionItemSelected event of this sap.m.Input.

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

detachValueHelpRequest

Detaches event handler fnFunction from the valueHelpRequest event of this sap.m.Input.

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

sap.m.Input.extend

Creates a new subclass of class sap.m.Input 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.

fireLiveChange

Fires event liveChange to attached listeners.

fireSubmit

Fires event submit to attached listeners.

fireSuggest

Fires event suggest to attached listeners.

fireSuggestionItemSelected

Fires event suggestionItemSelected to attached listeners.

fireValueHelpRequest

Fires event valueHelpRequest to attached listeners.

getAccessibilityInfo

Gets accessibility information for the input.

References:

  • sap.ui.core.Control#getAccessibilityInfo

getAutocomplete

Gets current value of property autocomplete.

Specifies whether autocomplete is enabled. Works only if "showSuggestion" property is set to true. Note: The autocomplete feature is disabled on Android devices due to a OS specific issue.

Default value is true.

getDateFormat

Gets current value of property dateFormat.

Only used if type=date and no datepicker is available. The data is displayed and the user input is parsed according to this format. Note: The value property is always of the form RFC 3339 (YYYY-MM-dd).

Default value is 'YYYY-MM-dd'.

Since 1.9.1 <code>sap.m.DatePicker</code>, <code>sap.m.TimePicker</code> or <code>sap.m.DateTimePicker</code> should be used for date/time inputs and formating.
getDescription

Gets current value of property description.

The description is a text after the input field, e.g. units of measurement, currencies.

getDOMValue

Gets the inner input DOM value.

getEnableSuggestionsHighlighting

Gets current value of property enableSuggestionsHighlighting.

Specifies whether the suggestions highlighting is enabled.

Default value is true.

getEnableTableAutoPopinMode

Gets current value of property enableTableAutoPopinMode.

Enables the autoPopinMode of sap.m.Table, when the input has tabular suggestions. Note: The autoPopinMode overwrites the demandPopin and the minScreenWidth properties of the sap.m.Column. When setting, enableTableAutoPopinMode, from true to false, the application must reconfigure the demandPopin and minScreenWidth properties of the sap.m.Column control by itself.

Default value is false.

getFieldWidth

Gets current value of property fieldWidth.

This property only takes effect if the description property is set. It controls the distribution of space between the input field and the description text. The default value is 50% leaving the other 50% for the description.

Default value is '50%'.

getFilterSuggests

Gets current value of property filterSuggests.

Defines whether to filter the provided suggestions before showing them to the user.

Default value is true.

getMaxLength

Gets current value of property maxLength.

Maximum number of characters. Value '0' means the feature is switched off. This parameter is not compatible with the input type sap.m.InputType.Number. If the input type is set to Number, the maxLength value is ignored.

Default value is 0.

getMaxSuggestionWidth

Gets current value of property maxSuggestionWidth.

If set, the value of this parameter will control the horizontal size of the suggestion list to display more data. This allows suggestion lists to be wider than the input field if there is enough space available. By default, the suggestion list is always as wide as the input field. Note: The value will be ignored if the actual width of the input field is larger than the specified parameter value.

sap.m.Input.getMetadata

Returns a metadata object for class sap.m.Input.

getSelectedItem

ID of the element which is the current target of the association selectedItem, or null.

getSelectedKey

Gets current value of property selectedKey.

Defines the key of the selected item.

Note: If duplicate keys exist, the first item matching the key is used.

Default value is empty string.

getSelectedRow

ID of the element which is the current target of the association selectedRow, or null.

getShowClearIcon

Gets current value of property showClearIcon.

Specifies whether clear icon is shown. Pressing the icon will clear input's value and fire the change and liveChange events.

Default value is false.

getShowSuggestion

Gets current value of property showSuggestion.

If this is set to true, suggest event is fired when user types in the input. Changing the suggestItems aggregation in suggest event listener will show suggestions within a popup. When runs on phone, input will first open a dialog where the input and suggestions are shown. When runs on a tablet, the suggestions are shown in a popup next to the input.

Default value is false.

getShowTableSuggestionValueHelp

Gets current value of property showTableSuggestionValueHelp.

For tabular suggestions, this flag will show/hide the button at the end of the suggestion table that triggers the event "valueHelpRequest" when pressed. The default value is true.

Note: If suggestions are not tabular or no suggestions are used, the button will not be displayed and this flag is without effect.

Default value is true.

getShowValueHelp

Gets current value of property showValueHelp.

If set to true, a value help indicator will be displayed inside the control. When clicked the event "valueHelpRequest" will be fired.

Default value is false.

getShowValueStateMessage

Getter for property showValueStateMessage. Whether the value state message should be shown. This property is already available for sap.m.Input since 1.16.0.

Default value is true

getStartSuggestion

Gets current value of property startSuggestion.

Minimum length of the entered text in input before suggest event is fired. The default value is 1 which means the suggest event is fired after user types in input.

Note: When it's set to 0, suggest event is fired when input with no text gets focus. In this case no suggestion popup will open.

Default value is 1.

getSuggestionColumns

Gets content of aggregation suggestionColumns.

The suggestionColumns and suggestionRows are for tabular input suggestions. This aggregation allows for binding the table columns; for more details see the aggregation "suggestionRows".

getSuggestionItemByKey

Gets the item with the given key from the aggregation suggestionItems. Note: If duplicate keys exist, the first item matching the key is returned.

getSuggestionItems

Gets content of aggregation suggestionItems.

Defines the items displayed in the suggestion popup. Changing this aggregation (by calling addSuggestionItem, insertSuggestionItem, removeSuggestionItem, removeAllSuggestionItems, or destroySuggestionItems) after Input is rendered opens/closes the suggestion popup.

To display suggestions with two text values, add sap.ui.core.ListItem as SuggestionItems (since 1.21.1). For the selected ListItem, only the first value is returned to the input field.

Note: Only text and additionalText property values of the item are displayed. For example, if an icon is set, it is ignored. To display more information per item (including icons), you can use the suggestionRows aggregation.

Note: Disabled items are not visualized in the list with the suggestions, however they can still be accessed through the aggregation. Note: If suggestionItems & suggestionRows are set in parallel, the last aggeragtion to come would overwrite the previous ones.

getSuggestionRows

Gets content of aggregation suggestionRows.

The suggestionColumns and suggestionRows are for tabular input suggestions. This aggregation allows for binding the table cells. The items of this aggregation are to be bound directly or to set in the suggest event method. Note: If suggestionItems & suggestionRows are set in parallel, the last aggeragtion to come would overwrite the previous ones.

getSuggestionRowValidator

Gets current value of property suggestionRowValidator.

Defines the validation callback function called when a suggestion row gets selected.

Default value is empty string.

getTextFormatMode

Gets current value of property textFormatMode.

Defines the display text format mode.

Default value is Value.

getTextFormatter

Gets current value of property textFormatter.

Defines the display text formatter function.

Default value is empty string.

getType

Gets current value of property type.

HTML type of the internal input tag (e.g. Text, Number, Email, Phone). The particular effect of this property differs depending on the browser and the current language settings, especially for the type Number.
This parameter is intended to be used with touch devices that use different soft keyboard layouts depending on the given input type.
Only the default value sap.m.InputType.Text may be used in combination with data model formats. sap.ui.model defines extended formats that are mostly incompatible with normal HTML representations for numbers and dates.

Default value is Text.

getValue

Gets the input value.

getValueHelpIconSrc

Gets current value of property valueHelpIconSrc.

Set custom value help icon.

Default value is "sap-icon://value-help".

getValueHelpOnly

Gets current value of property valueHelpOnly.

If set to true, direct text input is disabled and the control will trigger the event "valueHelpRequest" for all user interactions. The properties "showValueHelp", "editable", and "enabled" must be set to true, otherwise the property will have no effect

Default value is false.

getValueLiveUpdate

Gets current value of property valueLiveUpdate.

Indicates when the value gets updated with the user changes: At each keystroke (true) or first when the user presses enter or tabs out (false).

Note: When set to true and the value of the Input control is bound to a model, the change event becomes obsolete and will not be fired, as the value in the model will be updated each time the user provides input. In such cases, subscription to the liveChange event is more appropriate, as it corresponds to the way the underlying model gets updated.

Default value is false.

getValueStateText

Getter for property valueStateText. The text which is shown in the value state message popup. If not specfied a default text is shown. This property is already available for sap.m.Input since 1.16.0.

Default value is empty/undefined

indexOfSuggestionColumn

Checks for the provided sap.m.Column in the aggregation suggestionColumns. and returns its index if found or -1 otherwise.

indexOfSuggestionItem

Checks for the provided sap.ui.core.Item in the aggregation suggestionItems. and returns its index if found or -1 otherwise.

indexOfSuggestionRow

Checks for the provided sap.m.ColumnListItem in the aggregation suggestionRows. and returns its index if found or -1 otherwise.

insertSuggestionColumn

Inserts a suggestionColumn into the aggregation suggestionColumns.

insertSuggestionItem

Inserts suggestion item.

insertSuggestionRow

Inserts a suggestionRow into the aggregation suggestionRows.

invalidate

Invalidates the control.

isMobileDevice

Indicates whether the control should use sap.m.Dialog or not.

isValueHelpOnlyOpener

Gets the supported openers for the valueHelpOnly. In the context of the Input, all targets are valid.

onBeforeRendering

Overwrites the onBeforeRendering.

onchange

Event handler for browsers' change event.

onfocusin

Event handler for the onFocusIn event.

oninput

Event handler for user input.

onmousedown

Keyboard handler for the onMouseDown event.

onsapenter

Keyboard handler for enter key.

onsapescape

Keyboard handler for escape key.

onsapfocusleave

Keyboard handler for the onFocusLeave event.

onsapright

Finalizes autocomplete and fires liveChange event eventually.

ontap

Fire valueHelpRequest event on tap.

preventChangeOnFocusLeave

Hook method to prevent the change event from being fired when the text input field loses focus.

removeAllSuggestionColumns

Removes all the controls from the aggregation suggestionColumns.

Additionally, it unregisters them from the hosting UIArea.

removeAllSuggestionItems

Removes all suggestion items.

removeAllSuggestionRows

Removes all the controls from the aggregation suggestionRows.

Additionally, it unregisters them from the hosting UIArea.

removeSuggestionColumn

Removes a suggestionColumn from the aggregation suggestionColumns.

removeSuggestionItem

Removes suggestion item.

removeSuggestionRow

Removes a suggestionRow from the aggregation suggestionRows.

setAutocomplete

Sets a new value for property autocomplete.

Specifies whether autocomplete is enabled. Works only if "showSuggestion" property is set to true. Note: The autocomplete feature is disabled on Android devices due to a OS specific issue.

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

Default value is true.

setDateFormat

Sets a new value for property dateFormat.

Only used if type=date and no datepicker is available. The data is displayed and the user input is parsed according to this format. Note: The value property is always of the form RFC 3339 (YYYY-MM-dd).

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

Default value is 'YYYY-MM-dd'.

Since 1.9.1 <code>sap.m.DatePicker</code>, <code>sap.m.TimePicker</code> or <code>sap.m.DateTimePicker</code> should be used for date/time inputs and formating.
setDescription

Sets a new value for property description.

The description is a text after the input field, e.g. units of measurement, currencies.

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

setDOMValue

Sets the inner input DOM value.

setEnableSuggestionsHighlighting

Sets a new value for property enableSuggestionsHighlighting.

Specifies whether the suggestions highlighting is enabled.

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

Default value is true.

setEnableTableAutoPopinMode

Sets a new value for property enableTableAutoPopinMode.

Enables the autoPopinMode of sap.m.Table, when the input has tabular suggestions. Note: The autoPopinMode overwrites the demandPopin and the minScreenWidth properties of the sap.m.Column. When setting, enableTableAutoPopinMode, from true to false, the application must reconfigure the demandPopin and minScreenWidth properties of the sap.m.Column control by itself.

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

Default value is false.

setFieldWidth

Sets a new value for property fieldWidth.

This property only takes effect if the description property is set. It controls the distribution of space between the input field and the description text. The default value is 50% leaving the other 50% for the description.

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

Default value is '50%'.

setFilterFunction

Sets a custom filter function for suggestions. The default is to check whether the first item text begins with the typed value. For one and two-value suggestions this callback function will operate on sap.ui.core.Item types, for tabular suggestions the function will operate on sap.m.ColumnListItem types.

setFilterSuggests

Sets a new value for property filterSuggests.

Defines whether to filter the provided suggestions before showing them to the user.

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

Default value is true.

setMaxLength

Sets a new value for property maxLength.

Maximum number of characters. Value '0' means the feature is switched off. This parameter is not compatible with the input type sap.m.InputType.Number. If the input type is set to Number, the maxLength value is ignored.

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

Default value is 0.

setMaxSuggestionWidth

Sets a new value for property maxSuggestionWidth.

If set, the value of this parameter will control the horizontal size of the suggestion list to display more data. This allows suggestion lists to be wider than the input field if there is enough space available. By default, the suggestion list is always as wide as the input field. Note: The value will be ignored if the actual width of the input field is larger than the specified parameter value.

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

setRowResultFunction

Sets a custom result filter function for tabular suggestions to select the text that is passed to the input field. Default is to check whether the first cell with a "text" property begins with the typed value. For one value and two-value suggestions this callback function is not called.

setSelectedItem

Sets the selectedItem association.

setSelectedKey

Sets the selectedKey property.

Default value is an empty string "" or undefined.

setSelectedRow

Sets the selectedRow association. Default value is null.

setShowClearIcon

Sets a new value for property showClearIcon.

Specifies whether clear icon is shown. Pressing the icon will clear input's value and fire the change and liveChange events.

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

Default value is false.

setShowSuggestion

Sets a new value for property showSuggestion.

If this is set to true, suggest event is fired when user types in the input. Changing the suggestItems aggregation in suggest event listener will show suggestions within a popup. When runs on phone, input will first open a dialog where the input and suggestions are shown. When runs on a tablet, the suggestions are shown in a popup next to the input.

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

Default value is false.

setShowTableSuggestionValueHelp

Shows value help suggestions in table.

setShowValueHelp

Sets a new value for property showValueHelp.

If set to true, a value help indicator will be displayed inside the control. When clicked the event "valueHelpRequest" will be fired.

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

Default value is false.

setShowValueStateMessage

Setter for property showValueStateMessage.

Default value is true

setStartSuggestion

Sets a new value for property startSuggestion.

Minimum length of the entered text in input before suggest event is fired. The default value is 1 which means the suggest event is fired after user types in input.

Note: When it's set to 0, suggest event is fired when input with no text gets focus. In this case no suggestion popup will open.

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

Default value is 1.

setSuggestionRowValidator

Sets a new value for property suggestionRowValidator.

Defines the validation callback function called when a suggestion row gets selected.

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

Default value is empty string.

setTextFormatMode

Sets a new value for property textFormatMode.

Defines the display text format mode.

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

Default value is Value.

setTextFormatter

Sets a new value for property textFormatter.

Defines the display text formatter function.

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

Default value is empty string.

setType

Sets a new value for property type.

HTML type of the internal input tag (e.g. Text, Number, Email, Phone). The particular effect of this property differs depending on the browser and the current language settings, especially for the type Number.
This parameter is intended to be used with touch devices that use different soft keyboard layouts depending on the given input type.
Only the default value sap.m.InputType.Text may be used in combination with data model formats. sap.ui.model defines extended formats that are mostly incompatible with normal HTML representations for numbers and dates.

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

Default value is Text.

setValue

Setter for property value.

Default value is empty/undefined.

setValueHelpIconSrc

Sets a new value for property valueHelpIconSrc.

Set custom value help icon.

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

Default value is "sap-icon://value-help".

setValueHelpOnly

Sets a new value for property valueHelpOnly.

If set to true, direct text input is disabled and the control will trigger the event "valueHelpRequest" for all user interactions. The properties "showValueHelp", "editable", and "enabled" must be set to true, otherwise the property will have no effect

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

Default value is false.

setValueLiveUpdate

Sets a new value for property valueLiveUpdate.

Indicates when the value gets updated with the user changes: At each keystroke (true) or first when the user presses enter or tabs out (false).

Note: When set to true and the value of the Input control is bound to a model, the change event becomes obsolete and will not be fired, as the value in the model will be updated each time the user provides input. In such cases, subscription to the liveChange event is more appropriate, as it corresponds to the way the underlying model gets updated.

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

Default value is false.

setValueStateText

Setter for property valueStateText.

Default value is empty/undefined

showItems

Opens the SuggestionsPopover with the available items.

unbindSuggestionColumns

Unbinds aggregation suggestionColumns from model data.

unbindSuggestionRows

Unbinds aggregation suggestionRows from model data.

updateInputField

Updates the inner input field.

updateSuggestionItems

Update suggestion items.

_decoratePopupInput

Modifies Dialog's Input instance

Param Type DefaultValue Description
oInput sap.m.Input

addSuggestionColumn

Adds some suggestionColumn to the aggregation suggestionColumns.

Param Type DefaultValue Description
oSuggestionColumn sap.m.Column

The suggestionColumn to add; if empty, nothing is inserted

addSuggestionItem

Adds suggestion item.

Param Type DefaultValue Description
oItem sap.ui.core.Item

Suggestion item.

addSuggestionRow

Adds some suggestionRow to the aggregation suggestionRows.

Param Type DefaultValue Description
vSuggestionRow sap.m.ColumnListItem sap.m.GroupHeaderListItem

The suggestionRow to add; if empty, nothing is inserted

attachLiveChange

Attaches event handler fnFunction to the liveChange event of this sap.m.Input.

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

Fired when the value of the input is changed by user interaction - each keystroke, delete, paste, etc.

Note: Browsing autocomplete suggestions does not fires the event.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.m.Input itself

attachSubmit

Attaches event handler fnFunction to the submit event of this sap.m.Input.

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

This event is fired when user presses the Enter key on the input.

Notes:

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.m.Input itself

attachSuggest

Attaches event handler fnFunction to the suggest event of this sap.m.Input.

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

This event is fired when user types in the input and showSuggestion is set to true. Changing the suggestItems aggregation will show the suggestions within a popup.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.m.Input itself

attachSuggestionItemSelected

Attaches event handler fnFunction to the suggestionItemSelected event of this sap.m.Input.

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

This event is fired when suggestionItem shown in suggestion popup are selected. This event is only fired when showSuggestion is set to true and there are suggestionItems shown in the suggestion popup.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.m.Input itself

attachValueHelpRequest

Attaches event handler fnFunction to the valueHelpRequest event of this sap.m.Input.

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

When the value help indicator is clicked, this event will be fired.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.m.Input itself

bindSuggestionColumns

Binds aggregation suggestionColumns to model data.

See ManagedObject.bindAggregation for a detailed description of the possible properties of oBindingInfo.

Param Type DefaultValue Description
oBindingInfo sap.ui.base.ManagedObject.AggregationBindingInfo

The binding information

bindSuggestionRows

Binds aggregation suggestionRows to model data.

See ManagedObject.bindAggregation for a detailed description of the possible properties of oBindingInfo.

Param Type DefaultValue Description
oBindingInfo sap.ui.base.ManagedObject.AggregationBindingInfo

The binding information

cancelPendingSuggest

Cancels any pending suggestions.

clone

Clones input.

closeSuggestions

Closes the suggestion list.

destroySuggestionColumns

Destroys all the suggestionColumns in the aggregation suggestionColumns.

destroySuggestionItems

Destroys suggestion items.

destroySuggestionRows

Destroys all the suggestionRows in the aggregation suggestionRows.

detachLiveChange

Detaches event handler fnFunction from the liveChange event of this sap.m.Input.

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

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachSubmit

Detaches event handler fnFunction from the submit event of this sap.m.Input.

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

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachSuggest

Detaches event handler fnFunction from the suggest event of this sap.m.Input.

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

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachSuggestionItemSelected

Detaches event handler fnFunction from the suggestionItemSelected event of this sap.m.Input.

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

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachValueHelpRequest

Detaches event handler fnFunction from the valueHelpRequest event of this sap.m.Input.

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

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

sap.m.Input.extend

Creates a new subclass of class sap.m.Input 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.

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

fireLiveChange

Fires event liveChange to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

value string

The current value of the input, after a live change event.

escPressed boolean

Indicates that ESC key triggered the event. Note: This parameter will not be sent unless the ESC key is pressed.

previousValue string

The value of the input before pressing ESC key. Note: This parameter will not be sent unless the ESC key is pressed.

fireSubmit

Fires event submit to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

value string

The new value of the input.

fireSuggest

Fires event suggest to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

suggestValue string

The current value which has been typed in the input.

suggestionColumns sap.m.ListBase

The suggestion list is passed to this event for convenience. If you use list-based or tabular suggestions, fill the suggestionList with the items you want to suggest. Otherwise, directly add the suggestions to the "suggestionItems" aggregation of the input control.

fireSuggestionItemSelected

Fires event suggestionItemSelected to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

selectedItem sap.ui.core.Item

This is the item selected in the suggestion popup for one and two-value suggestions. For tabular suggestions, this value will not be set.

selectedRow sap.m.ColumnListItem

This is the row selected in the tabular suggestion popup represented as a ColumnListItem. For one and two-value suggestions, this value will not be set.

Note: The row result function to select a result value for the string is already executed at this time. To pick different value for the input field or to do follow up steps after the item has been selected.

fireValueHelpRequest

Fires event valueHelpRequest to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fromSuggestions boolean

The event parameter is set to true, when the button at the end of the suggestion table is clicked, otherwise false. It can be used to determine whether the "value help" trigger or the "show all items" trigger has been pressed.

getAccessibilityInfo

Gets accessibility information for the input.

References:

getAutocomplete

Gets current value of property autocomplete.

Specifies whether autocomplete is enabled. Works only if "showSuggestion" property is set to true. Note: The autocomplete feature is disabled on Android devices due to a OS specific issue.

Default value is true.

getDateFormat

Gets current value of property dateFormat.

Only used if type=date and no datepicker is available. The data is displayed and the user input is parsed according to this format. Note: The value property is always of the form RFC 3339 (YYYY-MM-dd).

Default value is 'YYYY-MM-dd'.

Since 1.9.1 <code>sap.m.DatePicker</code>, <code>sap.m.TimePicker</code> or <code>sap.m.DateTimePicker</code> should be used for date/time inputs and formating.

getDescription

Gets current value of property description.

The description is a text after the input field, e.g. units of measurement, currencies.

getDOMValue

Gets the inner input DOM value.

getEnableSuggestionsHighlighting

Gets current value of property enableSuggestionsHighlighting.

Specifies whether the suggestions highlighting is enabled.

Default value is true.

getEnableTableAutoPopinMode

Gets current value of property enableTableAutoPopinMode.

Enables the autoPopinMode of sap.m.Table, when the input has tabular suggestions. Note: The autoPopinMode overwrites the demandPopin and the minScreenWidth properties of the sap.m.Column. When setting, enableTableAutoPopinMode, from true to false, the application must reconfigure the demandPopin and minScreenWidth properties of the sap.m.Column control by itself.

Default value is false.

getFieldWidth

Gets current value of property fieldWidth.

This property only takes effect if the description property is set. It controls the distribution of space between the input field and the description text. The default value is 50% leaving the other 50% for the description.

Default value is '50%'.

getFilterSuggests

Gets current value of property filterSuggests.

Defines whether to filter the provided suggestions before showing them to the user.

Default value is true.

getMaxLength

Gets current value of property maxLength.

Maximum number of characters. Value '0' means the feature is switched off. This parameter is not compatible with the input type sap.m.InputType.Number. If the input type is set to Number, the maxLength value is ignored.

Default value is 0.

getMaxSuggestionWidth

Gets current value of property maxSuggestionWidth.

If set, the value of this parameter will control the horizontal size of the suggestion list to display more data. This allows suggestion lists to be wider than the input field if there is enough space available. By default, the suggestion list is always as wide as the input field. Note: The value will be ignored if the actual width of the input field is larger than the specified parameter value.

sap.m.Input.getMetadata

Returns a metadata object for class sap.m.Input.

getSelectedItem

ID of the element which is the current target of the association selectedItem, or null.

getSelectedKey

Gets current value of property selectedKey.

Defines the key of the selected item.

Note: If duplicate keys exist, the first item matching the key is used.

Default value is empty string.

getSelectedRow

ID of the element which is the current target of the association selectedRow, or null.

getShowClearIcon

Gets current value of property showClearIcon.

Specifies whether clear icon is shown. Pressing the icon will clear input's value and fire the change and liveChange events.

Default value is false.

getShowSuggestion

Gets current value of property showSuggestion.

If this is set to true, suggest event is fired when user types in the input. Changing the suggestItems aggregation in suggest event listener will show suggestions within a popup. When runs on phone, input will first open a dialog where the input and suggestions are shown. When runs on a tablet, the suggestions are shown in a popup next to the input.

Default value is false.

getShowTableSuggestionValueHelp

Gets current value of property showTableSuggestionValueHelp.

For tabular suggestions, this flag will show/hide the button at the end of the suggestion table that triggers the event "valueHelpRequest" when pressed. The default value is true.

Note: If suggestions are not tabular or no suggestions are used, the button will not be displayed and this flag is without effect.

Default value is true.

getShowValueHelp

Gets current value of property showValueHelp.

If set to true, a value help indicator will be displayed inside the control. When clicked the event "valueHelpRequest" will be fired.

Default value is false.

getShowValueStateMessage

Getter for property showValueStateMessage. Whether the value state message should be shown. This property is already available for sap.m.Input since 1.16.0.

Default value is true

getStartSuggestion

Gets current value of property startSuggestion.

Minimum length of the entered text in input before suggest event is fired. The default value is 1 which means the suggest event is fired after user types in input.

Note: When it's set to 0, suggest event is fired when input with no text gets focus. In this case no suggestion popup will open.

Default value is 1.

getSuggestionColumns

Gets content of aggregation suggestionColumns.

The suggestionColumns and suggestionRows are for tabular input suggestions. This aggregation allows for binding the table columns; for more details see the aggregation "suggestionRows".

getSuggestionItemByKey

Gets the item with the given key from the aggregation suggestionItems. Note: If duplicate keys exist, the first item matching the key is returned.

Param Type DefaultValue Description
sKey string

An item key that specifies the item to retrieve.

getSuggestionItems

Gets content of aggregation suggestionItems.

Defines the items displayed in the suggestion popup. Changing this aggregation (by calling addSuggestionItem, insertSuggestionItem, removeSuggestionItem, removeAllSuggestionItems, or destroySuggestionItems) after Input is rendered opens/closes the suggestion popup.

To display suggestions with two text values, add sap.ui.core.ListItem as SuggestionItems (since 1.21.1). For the selected ListItem, only the first value is returned to the input field.

Note: Only text and additionalText property values of the item are displayed. For example, if an icon is set, it is ignored. To display more information per item (including icons), you can use the suggestionRows aggregation.

Note: Disabled items are not visualized in the list with the suggestions, however they can still be accessed through the aggregation. Note: If suggestionItems & suggestionRows are set in parallel, the last aggeragtion to come would overwrite the previous ones.

getSuggestionRows

Gets content of aggregation suggestionRows.

The suggestionColumns and suggestionRows are for tabular input suggestions. This aggregation allows for binding the table cells. The items of this aggregation are to be bound directly or to set in the suggest event method. Note: If suggestionItems & suggestionRows are set in parallel, the last aggeragtion to come would overwrite the previous ones.

getSuggestionRowValidator

Gets current value of property suggestionRowValidator.

Defines the validation callback function called when a suggestion row gets selected.

Default value is empty string.

getTextFormatMode

Gets current value of property textFormatMode.

Defines the display text format mode.

Default value is Value.

getTextFormatter

Gets current value of property textFormatter.

Defines the display text formatter function.

Default value is empty string.

getType

Gets current value of property type.

HTML type of the internal input tag (e.g. Text, Number, Email, Phone). The particular effect of this property differs depending on the browser and the current language settings, especially for the type Number.
This parameter is intended to be used with touch devices that use different soft keyboard layouts depending on the given input type.
Only the default value sap.m.InputType.Text may be used in combination with data model formats. sap.ui.model defines extended formats that are mostly incompatible with normal HTML representations for numbers and dates.

Default value is Text.

getValue

Gets the input value.

getValueHelpIconSrc

Gets current value of property valueHelpIconSrc.

Set custom value help icon.

Default value is "sap-icon://value-help".

getValueHelpOnly

Gets current value of property valueHelpOnly.

If set to true, direct text input is disabled and the control will trigger the event "valueHelpRequest" for all user interactions. The properties "showValueHelp", "editable", and "enabled" must be set to true, otherwise the property will have no effect

Default value is false.

getValueLiveUpdate

Gets current value of property valueLiveUpdate.

Indicates when the value gets updated with the user changes: At each keystroke (true) or first when the user presses enter or tabs out (false).

Note: When set to true and the value of the Input control is bound to a model, the change event becomes obsolete and will not be fired, as the value in the model will be updated each time the user provides input. In such cases, subscription to the liveChange event is more appropriate, as it corresponds to the way the underlying model gets updated.

Default value is false.

getValueStateText

Getter for property valueStateText. The text which is shown in the value state message popup. If not specfied a default text is shown. This property is already available for sap.m.Input since 1.16.0.

Default value is empty/undefined

indexOfSuggestionColumn

Checks for the provided sap.m.Column in the aggregation suggestionColumns. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oSuggestionColumn sap.m.Column

The suggestionColumn whose index is looked for

indexOfSuggestionItem

Checks for the provided sap.ui.core.Item in the aggregation suggestionItems. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oSuggestionItem sap.ui.core.Item

The suggestionItem whose index is looked for

indexOfSuggestionRow

Checks for the provided sap.m.ColumnListItem in the aggregation suggestionRows. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
vSuggestionRow sap.m.ColumnListItem sap.m.GroupHeaderListItem

The suggestionRow whose index is looked for

insertSuggestionColumn

Inserts a suggestionColumn into the aggregation suggestionColumns.

Param Type DefaultValue Description
oSuggestionColumn sap.m.Column

The suggestionColumn to insert; if empty, nothing is inserted

iIndex int

The 0-based index the suggestionColumn should be inserted at; for a negative value of iIndex, the suggestionColumn is inserted at position 0; for a value greater than the current size of the aggregation, the suggestionColumn is inserted at the last position

insertSuggestionItem

Inserts suggestion item.

Param Type DefaultValue Description
oItem sap.ui.core.Item

Suggestion item.

iIndex int

Index to be inserted.

insertSuggestionRow

Inserts a suggestionRow into the aggregation suggestionRows.

Param Type DefaultValue Description
vSuggestionRow sap.m.ColumnListItem sap.m.GroupHeaderListItem

The suggestionRow to insert; if empty, nothing is inserted

iIndex int

The 0-based index the suggestionRow should be inserted at; for a negative value of iIndex, the suggestionRow is inserted at position 0; for a value greater than the current size of the aggregation, the suggestionRow is inserted at the last position

invalidate

Invalidates the control.

isMobileDevice

Indicates whether the control should use sap.m.Dialog or not.

isValueHelpOnlyOpener

Gets the supported openers for the valueHelpOnly. In the context of the Input, all targets are valid.

Param Type DefaultValue Description
oTarget HTMLElement undefined

The target of the event.

onBeforeRendering

Overwrites the onBeforeRendering.

onchange

Event handler for browsers' change event.

Param Type DefaultValue Description
oEvent jQuery.Event

The event.

onfocusin

Event handler for the onFocusIn event.

Param Type DefaultValue Description
oEvent jQuery.Event

On focus in event.

oninput

Event handler for user input.

Param Type DefaultValue Description
oEvent jQuery.Event

User input.

onmousedown

Keyboard handler for the onMouseDown event.

Param Type DefaultValue Description
oEvent jQuery.Event

Keyboard event.

onsapenter

Keyboard handler for enter key.

Param Type DefaultValue Description
oEvent jQuery.Event

Keyboard event.

onsapescape

Keyboard handler for escape key.

Param Type DefaultValue Description
oEvent jQuery.Event

Keyboard event.

onsapfocusleave

Keyboard handler for the onFocusLeave event.

Param Type DefaultValue Description
oEvent jQuery.Event

Keyboard event.

onsapright

Finalizes autocomplete and fires liveChange event eventually.

ontap

Fire valueHelpRequest event on tap.

Param Type DefaultValue Description
oEvent jQuery.Event

Ontap event.

preventChangeOnFocusLeave

Hook method to prevent the change event from being fired when the text input field loses focus.

Param Type DefaultValue Description
oEvent jQuery.Event

The event object.

removeAllSuggestionColumns

Removes all the controls from the aggregation suggestionColumns.

Additionally, it unregisters them from the hosting UIArea.

removeAllSuggestionItems

Removes all suggestion items.

removeAllSuggestionRows

Removes all the controls from the aggregation suggestionRows.

Additionally, it unregisters them from the hosting UIArea.

removeSuggestionColumn

Removes a suggestionColumn from the aggregation suggestionColumns.

Param Type DefaultValue Description
vSuggestionColumn int string sap.m.Column

The suggestionColumn to remove or its index or id

removeSuggestionItem

Removes suggestion item.

Param Type DefaultValue Description
oItem sap.ui.core.Item

Suggestion item.

removeSuggestionRow

Removes a suggestionRow from the aggregation suggestionRows.

Param Type DefaultValue Description
vSuggestionRow int string sap.m.ColumnListItem sap.m.GroupHeaderListItem

The suggestionRow to remove or its index or id

setAutocomplete

Sets a new value for property autocomplete.

Specifies whether autocomplete is enabled. Works only if "showSuggestion" property is set to true. Note: The autocomplete feature is disabled on Android devices due to a OS specific issue.

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

Default value is true.

Param Type DefaultValue Description
bAutocomplete boolean true

New value for property autocomplete

setDateFormat

Sets a new value for property dateFormat.

Only used if type=date and no datepicker is available. The data is displayed and the user input is parsed according to this format. Note: The value property is always of the form RFC 3339 (YYYY-MM-dd).

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

Default value is 'YYYY-MM-dd'.

Since 1.9.1 <code>sap.m.DatePicker</code>, <code>sap.m.TimePicker</code> or <code>sap.m.DateTimePicker</code> should be used for date/time inputs and formating.
Param Type DefaultValue Description
sDateFormat string 'YYYY-MM-dd'

New value for property dateFormat

setDescription

Sets a new value for property description.

The description is a text after the input field, e.g. units of measurement, currencies.

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

Param Type DefaultValue Description
sDescription string

New value for property description

setDOMValue

Sets the inner input DOM value.

Param Type DefaultValue Description
value string

Dom value which will be set.

setEnableSuggestionsHighlighting

Sets a new value for property enableSuggestionsHighlighting.

Specifies whether the suggestions highlighting is enabled.

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

Default value is true.

Param Type DefaultValue Description
bEnableSuggestionsHighlighting boolean true

New value for property enableSuggestionsHighlighting

setEnableTableAutoPopinMode

Sets a new value for property enableTableAutoPopinMode.

Enables the autoPopinMode of sap.m.Table, when the input has tabular suggestions. Note: The autoPopinMode overwrites the demandPopin and the minScreenWidth properties of the sap.m.Column. When setting, enableTableAutoPopinMode, from true to false, the application must reconfigure the demandPopin and minScreenWidth properties of the sap.m.Column control by itself.

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

Default value is false.

Param Type DefaultValue Description
bEnableTableAutoPopinMode boolean false

New value for property enableTableAutoPopinMode

setFieldWidth

Sets a new value for property fieldWidth.

This property only takes effect if the description property is set. It controls the distribution of space between the input field and the description text. The default value is 50% leaving the other 50% for the description.

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

Default value is '50%'.

Param Type DefaultValue Description
sFieldWidth sap.ui.core.CSSSize '50%'

New value for property fieldWidth

setFilterFunction

Sets a custom filter function for suggestions. The default is to check whether the first item text begins with the typed value. For one and two-value suggestions this callback function will operate on sap.ui.core.Item types, for tabular suggestions the function will operate on sap.m.ColumnListItem types.

Param Type DefaultValue Description
fnFilter function

The filter function is called when displaying suggestion items and has two input parameters: the first one is the string that is currently typed in the input field and the second one is the item that is being filtered. Returning true will add this item to the popup, returning false will not display it.

setFilterSuggests

Sets a new value for property filterSuggests.

Defines whether to filter the provided suggestions before showing them to the user.

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

Default value is true.

Param Type DefaultValue Description
bFilterSuggests boolean true

New value for property filterSuggests

setMaxLength

Sets a new value for property maxLength.

Maximum number of characters. Value '0' means the feature is switched off. This parameter is not compatible with the input type sap.m.InputType.Number. If the input type is set to Number, the maxLength value is ignored.

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

Default value is 0.

Param Type DefaultValue Description
iMaxLength int 0

New value for property maxLength

setMaxSuggestionWidth

Sets a new value for property maxSuggestionWidth.

If set, the value of this parameter will control the horizontal size of the suggestion list to display more data. This allows suggestion lists to be wider than the input field if there is enough space available. By default, the suggestion list is always as wide as the input field. Note: The value will be ignored if the actual width of the input field is larger than the specified parameter value.

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

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

New value for property maxSuggestionWidth

setRowResultFunction

Sets a custom result filter function for tabular suggestions to select the text that is passed to the input field. Default is to check whether the first cell with a "text" property begins with the typed value. For one value and two-value suggestions this callback function is not called.

Param Type DefaultValue Description
fnFilter function

The result function is called with one parameter: the sap.m.ColumnListItem that is selected. The function must return a result string that will be displayed as the input field's value.

setSelectedItem

Sets the selectedItem association.

Param Type DefaultValue Description
oItem sap.ui.core.Item

New value for the selectedItem association. If an ID of a sap.ui.core.Item is given, the item with this ID becomes the selectedItem association. Alternatively, a sap.ui.core.Item instance may be given or null to clear the selection.

setSelectedKey

Sets the selectedKey property.

Default value is an empty string "" or undefined.

Param Type DefaultValue Description
sKey string

New value for property selectedKey. If the provided sKey is an empty string "" or undefined, the selection is cleared. If duplicate keys exist, the first item matching the key is selected.

setSelectedRow

Sets the selectedRow association. Default value is null.

Param Type DefaultValue Description
oListItem sap.m.ColumnListItem

New value for the selectedRow association. If an ID of a sap.m.ColumnListItem is given, the item with this ID becomes the selectedRow association. Alternatively, a sap.m.ColumnListItem instance may be given or null to clear the selection.

setShowClearIcon

Sets a new value for property showClearIcon.

Specifies whether clear icon is shown. Pressing the icon will clear input's value and fire the change and liveChange events.

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

Default value is false.

Param Type DefaultValue Description
bShowClearIcon boolean false

New value for property showClearIcon

setShowSuggestion

Sets a new value for property showSuggestion.

If this is set to true, suggest event is fired when user types in the input. Changing the suggestItems aggregation in suggest event listener will show suggestions within a popup. When runs on phone, input will first open a dialog where the input and suggestions are shown. When runs on a tablet, the suggestions are shown in a popup next to the input.

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

Default value is false.

Param Type DefaultValue Description
bShowSuggestion boolean false

New value for property showSuggestion

setShowTableSuggestionValueHelp

Shows value help suggestions in table.

Param Type DefaultValue Description
bValue boolean

Show suggestions.

setShowValueHelp

Sets a new value for property showValueHelp.

If set to true, a value help indicator will be displayed inside the control. When clicked the event "valueHelpRequest" will be fired.

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

Default value is false.

Param Type DefaultValue Description
bShowValueHelp boolean false

New value for property showValueHelp

setShowValueStateMessage

Setter for property showValueStateMessage.

Default value is true

Param Type DefaultValue Description
bShowValueStateMessage boolean

new value for property showValueStateMessage

setStartSuggestion

Sets a new value for property startSuggestion.

Minimum length of the entered text in input before suggest event is fired. The default value is 1 which means the suggest event is fired after user types in input.

Note: When it's set to 0, suggest event is fired when input with no text gets focus. In this case no suggestion popup will open.

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

Default value is 1.

Param Type DefaultValue Description
iStartSuggestion int 1

New value for property startSuggestion

setSuggestionRowValidator

Sets a new value for property suggestionRowValidator.

Defines the validation callback function called when a suggestion row gets selected.

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

Default value is empty string.

Param Type DefaultValue Description
oSuggestionRowValidator any ""

New value for property suggestionRowValidator

setTextFormatMode

Sets a new value for property textFormatMode.

Defines the display text format mode.

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

Default value is Value.

Param Type DefaultValue Description
sTextFormatMode sap.m.InputTextFormatMode Value

New value for property textFormatMode

setTextFormatter

Sets a new value for property textFormatter.

Defines the display text formatter function.

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

Default value is empty string.

Param Type DefaultValue Description
oTextFormatter any ""

New value for property textFormatter

setType

Sets a new value for property type.

HTML type of the internal input tag (e.g. Text, Number, Email, Phone). The particular effect of this property differs depending on the browser and the current language settings, especially for the type Number.
This parameter is intended to be used with touch devices that use different soft keyboard layouts depending on the given input type.
Only the default value sap.m.InputType.Text may be used in combination with data model formats. sap.ui.model defines extended formats that are mostly incompatible with normal HTML representations for numbers and dates.

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

Default value is Text.

Param Type DefaultValue Description
sType sap.m.InputType Text

New value for property type

setValue

Setter for property value.

Default value is empty/undefined.

Param Type DefaultValue Description
sValue string

New value for property value.

setValueHelpIconSrc

Sets a new value for property valueHelpIconSrc.

Set custom value help icon.

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

Default value is "sap-icon://value-help".

Param Type DefaultValue Description
sValueHelpIconSrc sap.ui.core.URI "sap-icon://value-help"

New value for property valueHelpIconSrc

setValueHelpOnly

Sets a new value for property valueHelpOnly.

If set to true, direct text input is disabled and the control will trigger the event "valueHelpRequest" for all user interactions. The properties "showValueHelp", "editable", and "enabled" must be set to true, otherwise the property will have no effect

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

Default value is false.

Param Type DefaultValue Description
bValueHelpOnly boolean false

New value for property valueHelpOnly

setValueLiveUpdate

Sets a new value for property valueLiveUpdate.

Indicates when the value gets updated with the user changes: At each keystroke (true) or first when the user presses enter or tabs out (false).

Note: When set to true and the value of the Input control is bound to a model, the change event becomes obsolete and will not be fired, as the value in the model will be updated each time the user provides input. In such cases, subscription to the liveChange event is more appropriate, as it corresponds to the way the underlying model gets updated.

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

Default value is false.

Param Type DefaultValue Description
bValueLiveUpdate boolean false

New value for property valueLiveUpdate

setValueStateText

Setter for property valueStateText.

Default value is empty/undefined

Param Type DefaultValue Description
sValueStateText string

new value for property valueStateText

showItems

Opens the SuggestionsPopover with the available items.

Param Type DefaultValue Description
fnFilter function

Function to filter the items shown in the SuggestionsPopover

unbindSuggestionColumns

Unbinds aggregation suggestionColumns from model data.

unbindSuggestionRows

Unbinds aggregation suggestionRows from model data.

updateInputField

Updates the inner input field.

updateSuggestionItems

Update suggestion items.