Class sap.ui.commons.SearchFieldModule: sap/ui/commons/SearchField
Allows the user to type search queries and to trigger the search. Optionally, suggestions can be added.
Deprecated API:Since version 1.38. Instead, use the sap.m.SearchField
control.
sClassName
and enriches it with the information contained in oClassInfo
.fnFunction
to the search
event of this sap.ui.commons.SearchField
.fnFunction
to the suggest
event of this sap.ui.commons.SearchField
.fnFunction
from the search
event of this sap.ui.commons.SearchField
.fnFunction
from the suggest
event of this sap.ui.commons.SearchField
.ariaDescribedBy
.ariaLabelledBy
.ariaDescribedBy
.ariaLabelledBy
. Accepts an object literal mSettings
that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.
The supported settings are:
- Properties
- enableListSuggest : boolean (default: true)
- showListExpander : boolean (default: true)
- enableClear : boolean (default: false)
- showExternalButton : boolean (default: false)
- enableCache : boolean (default: true)
- enableFilterMode : boolean (default: false)
- value : string (default: )
- enabled : boolean (default: true)
- editable : boolean (default: true)
- width : sap.ui.core.CSSSize
- maxLength : int (default: 0)
- valueState : sap.ui.core.ValueState (default: None)
- placeholder : string (default: )
- textAlign : sap.ui.core.TextAlign (default: Begin)
- visibleItemCount : int (default: 20)
- startSuggestion : int (default: 3)
- maxSuggestionItems : int (default: 10)
- maxHistoryItems : int (default: 0)
- Aggregations
- searchProvider : sap.ui.core.search.SearchProvider
- Events
In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.
{string} | sId? | ID for the new control, generated automatically if no ID is given |
{object} | mSettings? | Initial settings for the new control |
- Deprecated:
- Since version 1.38. Instead, use the
sap.m.SearchField
control.
{sap.ui.base.Event} | oControlEvent | |
{sap.ui.base.EventProvider} | oControlEvent.getSource | |
{object} | oControlEvent.getParameters | |
{string} | oControlEvent.getParameters.query | The search query |
{sap.ui.base.Event} | oControlEvent | |
{sap.ui.base.EventProvider} | oControlEvent.getSource | |
{object} | oControlEvent.getParameters | |
{string} | oControlEvent.getParameters.value | The value for which suggestions are required. |
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.
{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 |
{function} | Created class / constructor function |
{sap.ui.base.Metadata} | Metadata object describing this class |
ariaDescribedBy
. {string|sap.ui.core.Control} | vAriaDescribedBy | the ariaDescribedBy to add; if empty, nothing is inserted |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
ariaLabelledBy
. {string|sap.ui.core.Control} | vAriaLabelledBy | the ariaLabelledBy to add; if empty, nothing is inserted |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
fnFunction
to the search
event of this sap.ui.commons.SearchField
. When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.commons.SearchField
itself.
Event which is fired when the user triggers a search
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ui.commons.SearchField itself |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
fnFunction
to the suggest
event of this sap.ui.commons.SearchField
. When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.commons.SearchField
itself.
Event which is fired when new suggest values are required.
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ui.commons.SearchField itself |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
searchProvider
. {sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
fnFunction
from the search
event of this sap.ui.commons.SearchField
. The passed function and listener object must match the ones used for event registration.
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
fnFunction
from the suggest
event of this sap.ui.commons.SearchField
. The passed function and listener object must match the ones used for event registration.
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
search
to attached listeners. Expects the following event parameters:
query
of typestring
The search query
{Map} | mArguments? | The arguments to pass along with the event |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
suggest
to attached listeners. Expects the following event parameters:
value
of typestring
The value for which suggestions are required.
{Map} | mArguments? | The arguments to pass along with the event |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
ariaDescribedBy
. {sap.ui.core.Control[]} |
ariaLabelledBy
. {sap.ui.core.Control[]} |
editable
. Non-editable controls have different colors, depending on custom settings
Default value is true
.
{boolean} | Value of property editable |
enableCache
. When list suggestion is enabled all suggestions are cached and no suggest event is fired.
Default value is true
.
- Since:
- 1.10.3
{boolean} | Value of property enableCache |
enableClear
. Defines whether the clear functionality shall be active
Default value is false
.
{boolean} | Value of property enableClear |
enabled
. Disabled fields have different colors, and they can not be focused.
Default value is true
.
{boolean} | Value of property enabled |
enableFilterMode
. Defines whether the search event should also be fired when the SearchField is empty (like a Filter field) and when the clear button (if activated) is pressed.
Default value is false
.
{boolean} | Value of property enableFilterMode |
enableListSuggest
. Defines whether a pop up list shall be provided for suggestions
Default value is true
.
{boolean} | Value of property enableListSuggest |
maxHistoryItems
. Maximum number of history items in the suggestion list. 0 displays and stores no history. The history is locally stored on the client. Therefore do not activate this feature when this control handles confidential data.
Default value is 0
.
{int} | Value of property maxHistoryItems |
maxLength
. Maximum number of characters. Value '0' means the feature is switched off.
Default value is 0
.
{int} | Value of property maxLength |
maxSuggestionItems
. Maximum number of suggestion items in the suggestion list.
Default value is 10
.
{int} | Value of property maxSuggestionItems |
placeholder
. Placeholder for the input field.
Default value is .
- Since:
- 1.32
{string} | Value of property placeholder |
searchProvider
. Search provider instance which handles the suggestions for this SearchField (e.g. Open Search Protocol).
{sap.ui.core.search.SearchProvider} |
showExternalButton
. Defines whether an additional search button shall be displayed
Default value is false
.
{boolean} | Value of property showExternalButton |
showListExpander
. Defines whether the list expander shall be displayed in the case of an enabled list for suggestions. This feature is deactivated on mobile devices.
Default value is true
.
{boolean} | Value of property showListExpander |
startSuggestion
. Minimum length of the entered string triggering the suggestion list.
Default value is 3
.
{int} | Value of property startSuggestion |
textAlign
. Sets the horizontal alignment of the text
Default value is Begin
.
{sap.ui.core.TextAlign} | Value of property textAlign |
value
. Text that shall be displayed within the search field
Default value is .
{string} | Value of property value |
valueState
. Visualizes warnings or errors related to the input field. Possible values: Warning, Error, Success, None.
Default value is None
.
- Since:
- 1.32
{sap.ui.core.ValueState} | Value of property valueState |
visibleItemCount
. Defines the number of items in the suggestion list that shall be displayed at once. If the overall number of list items is higher than the setting, a scroll bar is provided.
Default value is 20
.
{int} | Value of property visibleItemCount |
width
. Control width in CSS-size
{sap.ui.core.CSSSize} | Value of property width |
ariaDescribedBy
. {sap.ui.core.Control[]} | An array of the removed elements (might be empty) |
ariaLabelledBy
. {sap.ui.core.Control[]} | An array of the removed elements (might be empty) |
ariaDescribedBy
. {int|string|sap.ui.core.Control} | vAriaDescribedBy | The ariaDescribedByto be removed or its index or ID |
{sap.ui.core.Control} | the removed ariaDescribedBy or null |
ariaLabelledBy
. {int|string|sap.ui.core.Control} | vAriaLabelledBy | The ariaLabelledByto be removed or its index or ID |
{sap.ui.core.Control} | the removed ariaLabelledBy or null |
editable
. Non-editable controls have different colors, depending on custom settings
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
{boolean} | bEditable | New value for property editable |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
enableCache
. When list suggestion is enabled all suggestions are cached and no suggest event is fired.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
{boolean} | bEnableCache | New value for property enableCache |
- Since:
- 1.10.3
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
enableClear
. Defines whether the clear functionality shall be active
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
{boolean} | bEnableClear | New value for property enableClear |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
enabled
. Disabled fields have different colors, and they can not be focused.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
{boolean} | bEnabled | New value for property enabled |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
enableFilterMode
. Defines whether the search event should also be fired when the SearchField is empty (like a Filter field) and when the clear button (if activated) is pressed.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
{boolean} | bEnableFilterMode | New value for property enableFilterMode |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
enableListSuggest
. Defines whether a pop up list shall be provided for suggestions
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
{boolean} | bEnableListSuggest | New value for property enableListSuggest |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
maxHistoryItems
. Maximum number of history items in the suggestion list. 0 displays and stores no history. The history is locally stored on the client. Therefore do not activate this feature when this control handles confidential data.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 0
.
{int} | iMaxHistoryItems | New value for property maxHistoryItems |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
maxLength
. Maximum number of characters. Value '0' means the feature is switched off.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 0
.
{int} | iMaxLength | New value for property maxLength |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
maxSuggestionItems
. Maximum number of suggestion items in the suggestion list.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 10
.
{int} | iMaxSuggestionItems | New value for property maxSuggestionItems |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
placeholder
. Placeholder for the input field.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is .
{string} | sPlaceholder | New value for property placeholder |
- Since:
- 1.32
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
searchProvider
. {sap.ui.core.search.SearchProvider} | oSearchProvider | The searchProvider to set |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
showExternalButton
. Defines whether an additional search button shall be displayed
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
{boolean} | bShowExternalButton | New value for property showExternalButton |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
showListExpander
. Defines whether the list expander shall be displayed in the case of an enabled list for suggestions. This feature is deactivated on mobile devices.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
{boolean} | bShowListExpander | New value for property showListExpander |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
startSuggestion
. Minimum length of the entered string triggering the suggestion list.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 3
.
{int} | iStartSuggestion | New value for property startSuggestion |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
textAlign
. Sets the horizontal alignment of the text
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Begin
.
{sap.ui.core.TextAlign} | sTextAlign | New value for property textAlign |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
value
. Text that shall be displayed within the search field
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is .
{string} | sValue | New value for property value |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
valueState
. Visualizes warnings or errors related to the input field. Possible values: Warning, Error, Success, None.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is None
.
{sap.ui.core.ValueState} | sValueState | New value for property valueState |
- Since:
- 1.32
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
visibleItemCount
. Defines the number of items in the suggestion list that shall be displayed at once. If the overall number of list items is higher than the setting, a scroll bar is provided.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 20
.
{int} | iVisibleItemCount | New value for property visibleItemCount |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
width
. Control width in CSS-size
When called with a value of null
or undefined
, the default value of the property will be restored.
{sap.ui.core.CSSSize} | sWidth | New value for property width |
{sap.ui.commons.SearchField} | Reference to this in order to allow method chaining |
{string} | sSSuggestValue | The value which was provided in the corresponding suggest event (parameter 'value') |
{string[]} | aASuggestions | The list of suggestions belonging to the suggest value |