Class sap.m.SearchFieldModule: sap/m/SearchField

extends Control
implements IFormContent

An input field to search for a specific item.

Overview

A search field is needed when the user needs to find specific information in large amounts of data. The search field is also the control of choice for filtering down a given amount of information.

Structure

The search input field can be used in two ways:

  • Manual search - The search is triggered after the user presses the search button. Manual search uses a “starts with” approach.
  • Live search (search-as-you-type) - The search is triggered after each button press. A suggestion list is shown below the search field. Live search uses a “contains” approach.

Usage

When to use:

  • Use live search whenever possible.
  • Use a manual search only if the amount of data is too large and if your app would otherwise run into performance issues.

Responsive Behavior

On mobile devices, there is no refresh button in the search field. "Pull Down to Refresh" is used instead. The "Pull Down to Refresh" arrow icon is animated and spins to signal that the user should release it.

Constructor Summary
new sap.m.SearchField(sId?, mSettings?)Constructor for a new SearchField.
Event Summary
liveChange(oControlEvent)This event is fired when the value of the search field is changed by a user - e.g.
search(oControlEvent)Event which is fired when the user triggers a search.
suggest(oControlEvent)This event is fired when the search field is initially focused or its value is changed by the user.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.m.SearchField.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.SearchField with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.SearchField.getMetadata()Returns a metadata object for class sap.m.SearchField.
addAriaDescribedBy(vAriaDescribedBy)Adds some ariaDescribedBy into the association ariaDescribedBy.
addAriaLabelledBy(vAriaLabelledBy)Adds some ariaLabelledBy into the association ariaLabelledBy.
addSuggestionItem(oSuggestionItem)Adds some suggestionItem to the aggregation suggestionItems.
attachLiveChange(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the liveChange event of this sap.m.SearchField.
attachSearch(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the search event of this sap.m.SearchField.
attachSuggest(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the suggest event of this sap.m.SearchField.
bindValue(oBindingInfo)Binds property value to model data.
destroySuggestionItems()Destroys all the suggestionItems in the aggregation suggestionItems.
detachLiveChange(fnFunction, oListener)Detaches event handler fnFunction from the liveChange event of this sap.m.SearchField.
detachSearch(fnFunction, oListener)Detaches event handler fnFunction from the search event of this sap.m.SearchField.
detachSuggest(fnFunction, oListener)Detaches event handler fnFunction from the suggest event of this sap.m.SearchField.
fireLiveChange(mParameters?)Fires event liveChange to attached listeners.
fireSearch(mParameters?)Fires event search to attached listeners.
fireSuggest(mParameters?)Fires event suggest to attached listeners.
getAriaDescribedBy()Returns array of IDs of the elements which are the current targets of the association ariaDescribedBy.
getAriaLabelledBy()Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
getEnabled()Gets current value of property enabled.
getEnableSuggestions()Gets current value of property enableSuggestions.
getMaxLength()Gets current value of property maxLength.
getPlaceholder()Gets current value of property placeholder.
getPopupAnchorDomRef()Function returns DOM element which acts as reference point for the opening suggestion menu
getRefreshButtonTooltip()Gets current value of property refreshButtonTooltip.
getShowRefreshButton()Gets current value of property showRefreshButton.
getShowSearchButton()Gets current value of property showSearchButton.
getSuggestionItems()Gets content of aggregation suggestionItems.
getValue()Gets current value of property value.
getVisible()Gets current value of property visible.
getWidth()Gets current value of property width.
indexOfSuggestionItem(oSuggestionItem)Checks for the provided sap.m.SuggestionItem in the aggregation suggestionItems.
insertSuggestionItem(oSuggestionItem, iIndex)Inserts a suggestionItem into the aggregation suggestionItems.
removeAllAriaDescribedBy()Removes all the controls in the association named ariaDescribedBy.
removeAllAriaLabelledBy()Removes all the controls in the association named ariaLabelledBy.
removeAllSuggestionItems()Removes all the controls from the aggregation suggestionItems.
removeAriaDescribedBy(vAriaDescribedBy)Removes an ariaDescribedBy from the association named ariaDescribedBy.
removeAriaLabelledBy(vAriaLabelledBy)Removes an ariaLabelledBy from the association named ariaLabelledBy.
removeSuggestionItem(vSuggestionItem)Removes a suggestionItem from the aggregation suggestionItems.
setEnabled(bEnabled)Sets a new value for property enabled.
setEnableSuggestions(bEnableSuggestions)Sets a new value for property enableSuggestions.
setMaxLength(iMaxLength)Sets a new value for property maxLength.
setPlaceholder(sPlaceholder)Sets a new value for property placeholder.
setRefreshButtonTooltip(sRefreshButtonTooltip)Sets a new value for property refreshButtonTooltip.
setShowRefreshButton(bShowRefreshButton)Sets a new value for property showRefreshButton.
setShowSearchButton(bShowSearchButton)Sets a new value for property showSearchButton.
setValue(sValue)Sets a new value for property value.
setVisible(bVisible)Sets a new value for property visible.
setWidth(sWidth)Sets a new value for property width.
suggest(bShow)Toggle visibility of the suggestion list.
unbindValue()Unbinds property value from model data.
getSelectOnFocus()Gets current value of property selectOnFocus.
getShowMagnifier()Gets current value of property showMagnifier.
setSelectOnFocus(bSelectOnFocus)Sets a new value for property selectOnFocus.
setShowMagnifier(bShowMagnifier)Sets a new value for property showMagnifier.
Constructor Detail
new sap.m.SearchField(sId?, mSettings?)

Constructor for a new SearchField.

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:

In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.

Parameters:
stringsId?ID for the new control, generated automatically if no ID is given
objectmSettings?Initial settings for the new control
Event Detail
liveChange(oControlEvent)
This event is fired when the value of the search field is changed by a user - e.g. at each key press. Do not invalidate or re-render a focused search field, especially during the liveChange event.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
stringoControlEvent.getParameters.newValueCurrent search string.
Since:
1.9.1
search(oControlEvent)
Event which is fired when the user triggers a search.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
stringoControlEvent.getParameters.queryThe search query string.
sap.m.SuggestionItemoControlEvent.getParameters.suggestionItemSuggestion list item in case if the user has selected an item from the suggestions list.
booleanoControlEvent.getParameters.refreshButtonPressedIndicates if the user pressed the refresh icon.
booleanoControlEvent.getParameters.clearButtonPressedIndicates if the user pressed the clear icon.
suggest(oControlEvent)
This event is fired when the search field is initially focused or its value is changed by the user. This event means that suggestion data should be updated, in case if suggestions are used. Use the value parameter to create new suggestions for it.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
stringoControlEvent.getParameters.suggestValueCurrent search string of the search field.
Since:
1.34
Method Detail
sap.m.SearchField.extend(sClassName, oClassInfo?, FNMetaImpl?): function

Creates a new subclass of class sap.m.SearchField with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

Parameters:
stringsClassNameName of the class being created
objectoClassInfo?Object literal with information about the class
functionFNMetaImpl?Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
functionCreated class / constructor function
sap.m.SearchField.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.SearchField.
Returns:
sap.ui.base.MetadataMetadata object describing this class
addAriaDescribedBy(vAriaDescribedBy): sap.m.SearchField
Adds some ariaDescribedBy into the association ariaDescribedBy.
Parameters:
sap.ui.core.ID|sap.ui.core.ControlvAriaDescribedBythe ariaDescribedBy to add; if empty, nothing is inserted
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
addAriaLabelledBy(vAriaLabelledBy): sap.m.SearchField
Adds some ariaLabelledBy into the association ariaLabelledBy.
Parameters:
sap.ui.core.ID|sap.ui.core.ControlvAriaLabelledBythe ariaLabelledBy to add; if empty, nothing is inserted
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
addSuggestionItem(oSuggestionItem): sap.m.SearchField
Adds some suggestionItem to the aggregation suggestionItems.
Parameters:
sap.m.SuggestionItemoSuggestionItemthe suggestionItem to add; if empty, nothing is inserted
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
Since:
1.34
attachLiveChange(oData?, fnFunction, oListener?): sap.m.SearchField

Attaches event handler fnFunction to the liveChange event of this sap.m.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.m.SearchField itself.

This event is fired when the value of the search field is changed by a user - e.g. at each key press. Do not invalidate or re-render a focused search field, especially during the liveChange event.

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.m.SearchField itself
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
Since:
1.9.1
attachSearch(oData?, fnFunction, oListener?): sap.m.SearchField

Attaches event handler fnFunction to the search event of this sap.m.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.m.SearchField itself.

Event which is fired when the user triggers a search.

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.m.SearchField itself
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
attachSuggest(oData?, fnFunction, oListener?): sap.m.SearchField

Attaches event handler fnFunction to the suggest event of this sap.m.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.m.SearchField itself.

This event is fired when the search field is initially focused or its value is changed by the user. This event means that suggestion data should be updated, in case if suggestions are used. Use the value parameter to create new suggestions for it.

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.m.SearchField itself
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
Since:
1.34
bindValue(oBindingInfo): sap.m.SearchField

Binds property value to model data.

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

Parameters:
objectoBindingInfoThe binding information
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
destroySuggestionItems(): sap.m.SearchField
Destroys all the suggestionItems in the aggregation suggestionItems.
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
Since:
1.34
detachLiveChange(fnFunction, oListener): sap.m.SearchField

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

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

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
Since:
1.9.1
detachSearch(fnFunction, oListener): sap.m.SearchField

Detaches event handler fnFunction from the search event of this sap.m.SearchField.

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

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
detachSuggest(fnFunction, oListener): sap.m.SearchField

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

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

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
Since:
1.34
fireLiveChange(mParameters?): sap.m.SearchField
Fires event liveChange to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
stringmParameters.newValue?Current search string.
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
Since:
1.9.1
fireSearch(mParameters?): sap.m.SearchField
Fires event search to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
stringmParameters.query?The search query string.
sap.m.SuggestionItemmParameters.suggestionItem?Suggestion list item in case if the user has selected an item from the suggestions list.
booleanmParameters.refreshButtonPressed?Indicates if the user pressed the refresh icon.
booleanmParameters.clearButtonPressed?Indicates if the user pressed the clear icon.
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
fireSuggest(mParameters?): sap.m.SearchField
Fires event suggest to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
stringmParameters.suggestValue?Current search string of the search field.
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
Since:
1.34
getAriaDescribedBy(): sap.ui.core.ID[]
Returns array of IDs of the elements which are the current targets of the association ariaDescribedBy.
Returns:
sap.ui.core.ID[]
getAriaLabelledBy(): sap.ui.core.ID[]
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Returns:
sap.ui.core.ID[]
getEnabled(): boolean

Gets current value of property enabled.

Boolean property to enable the control (default is true).

Default value is true.

Returns:
booleanValue of property enabled
getEnableSuggestions(): boolean

Gets current value of property enableSuggestions.

If true, a suggest event is fired when user types in the input and when the input is focused. On a phone device, a full screen dialog with suggestions is always shown even if the suggestions list is empty.

Default value is false.

Returns:
booleanValue of property enableSuggestions
Since:
1.34
getMaxLength(): int

Gets current value of property maxLength.

Maximum number of characters. Value '0' means the feature is switched off.

Default value is 0.

Returns:
intValue of property maxLength
getPlaceholder(): string

Gets current value of property placeholder.

Text shown when no value available. Default placeholder text is the word "Search" in the current local language (if supported) or in English.

Returns:
stringValue of property placeholder
getPopupAnchorDomRef(): domRef
Function returns DOM element which acts as reference point for the opening suggestion menu
Returns:
domRefthe DOM element at which to open the suggestion list
Since:
1.34
getRefreshButtonTooltip(): string

Gets current value of property refreshButtonTooltip.

Tooltip text of the refresh button. If it is not set, the tooltip of the SearchField (if any) is displayed. Tooltips are not displayed on touch devices.

Returns:
stringValue of property refreshButtonTooltip
Since:
1.16
getShowRefreshButton(): boolean

Gets current value of property showRefreshButton.

Set to true to display a refresh button in place of the search icon. By pressing the refresh button or F5 key on keyboard, the user can reload the results list without changing the search string.

Default value is false.

Returns:
booleanValue of property showRefreshButton
Since:
1.16
getShowSearchButton(): boolean

Gets current value of property showSearchButton.

Set to true to show the search button with the magnifier icon. If false, both the search and refresh buttons are not displayed even if the "showRefreshButton" property is true.

Default value is true.

Returns:
booleanValue of property showSearchButton
Since:
1.23
getSuggestionItems(): sap.m.SuggestionItem[]

Gets content of aggregation suggestionItems.

SuggestionItems are the items which will be shown in the suggestions list. The following properties can be used:

  • key is not displayed and may be used as internal technical field
  • text is displayed as normal suggestion text
  • icon
  • description - additional text may be used to visually display search item type or category
Returns:
sap.m.SuggestionItem[]
Since:
1.34
getValue(): string

Gets current value of property value.

Input Value.

Returns:
stringValue of property value
getVisible(): boolean

Gets current value of property visible.

Invisible inputs are not rendered.

Default value is true.

Returns:
booleanValue of property visible
getWidth(): sap.ui.core.CSSSize

Gets current value of property width.

Defines the CSS width of the input. If not set, width is 100%.

Returns:
sap.ui.core.CSSSizeValue of property width
indexOfSuggestionItem(oSuggestionItem): int
Checks for the provided sap.m.SuggestionItem in the aggregation suggestionItems. and returns its index if found or -1 otherwise.
Parameters:
sap.m.SuggestionItemoSuggestionItemThe suggestionItem whose index is looked for
Returns:
intThe index of the provided control in the aggregation if found, or -1 otherwise
Since:
1.34
insertSuggestionItem(oSuggestionItem, iIndex): sap.m.SearchField
Inserts a suggestionItem into the aggregation suggestionItems.
Parameters:
sap.m.SuggestionItemoSuggestionItemthe suggestionItem to insert; if empty, nothing is inserted
intiIndexthe 0-based index the suggestionItem should be inserted at; for a negative value of iIndex, the suggestionItem is inserted at position 0; for a value greater than the current size of the aggregation, the suggestionItem is inserted at the last position
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
Since:
1.34
removeAllAriaDescribedBy(): sap.ui.core.ID[]
Removes all the controls in the association named ariaDescribedBy.
Returns:
sap.ui.core.ID[]An array of the removed elements (might be empty)
removeAllAriaLabelledBy(): sap.ui.core.ID[]
Removes all the controls in the association named ariaLabelledBy.
Returns:
sap.ui.core.ID[]An array of the removed elements (might be empty)
removeAllSuggestionItems(): sap.m.SuggestionItem[]

Removes all the controls from the aggregation suggestionItems.

Additionally, it unregisters them from the hosting UIArea.

Returns:
sap.m.SuggestionItem[]An array of the removed elements (might be empty)
Since:
1.34
removeAriaDescribedBy(vAriaDescribedBy): sap.ui.core.ID
Removes an ariaDescribedBy from the association named ariaDescribedBy.
Parameters:
int|sap.ui.core.ID|sap.ui.core.ControlvAriaDescribedByThe ariaDescribedBy to be removed or its index or ID
Returns:
sap.ui.core.IDThe removed ariaDescribedBy or null
removeAriaLabelledBy(vAriaLabelledBy): sap.ui.core.ID
Removes an ariaLabelledBy from the association named ariaLabelledBy.
Parameters:
int|sap.ui.core.ID|sap.ui.core.ControlvAriaLabelledByThe ariaLabelledBy to be removed or its index or ID
Returns:
sap.ui.core.IDThe removed ariaLabelledBy or null
removeSuggestionItem(vSuggestionItem): sap.m.SuggestionItem
Removes a suggestionItem from the aggregation suggestionItems.
Parameters:
int|string|sap.m.SuggestionItemvSuggestionItemThe suggestionItem to remove or its index or id
Returns:
sap.m.SuggestionItemThe removed suggestionItem or null
Since:
1.34
setEnabled(bEnabled): sap.m.SearchField

Sets a new value for property enabled.

Boolean property to enable the control (default is true).

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

Default value is true.

Parameters:
booleanbEnabledNew value for property enabled
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
setEnableSuggestions(bEnableSuggestions): sap.m.SearchField

Sets a new value for property enableSuggestions.

If true, a suggest event is fired when user types in the input and when the input is focused. On a phone device, a full screen dialog with suggestions is always shown even if the suggestions list is empty.

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

Default value is false.

Parameters:
booleanbEnableSuggestionsNew value for property enableSuggestions
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
Since:
1.34
setMaxLength(iMaxLength): sap.m.SearchField

Sets a new value for property maxLength.

Maximum number of characters. Value '0' means the feature is switched off.

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

Default value is 0.

Parameters:
intiMaxLengthNew value for property maxLength
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
setPlaceholder(sPlaceholder): sap.m.SearchField

Sets a new value for property placeholder.

Text shown when no value available. Default placeholder text is the word "Search" in the current local language (if supported) or in English.

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

Parameters:
stringsPlaceholderNew value for property placeholder
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
setRefreshButtonTooltip(sRefreshButtonTooltip): sap.m.SearchField

Sets a new value for property refreshButtonTooltip.

Tooltip text of the refresh button. If it is not set, the tooltip of the SearchField (if any) is displayed. Tooltips are not displayed on touch devices.

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

Parameters:
stringsRefreshButtonTooltipNew value for property refreshButtonTooltip
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
Since:
1.16
setShowRefreshButton(bShowRefreshButton): sap.m.SearchField

Sets a new value for property showRefreshButton.

Set to true to display a refresh button in place of the search icon. By pressing the refresh button or F5 key on keyboard, the user can reload the results list without changing the search string.

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

Default value is false.

Parameters:
booleanbShowRefreshButtonNew value for property showRefreshButton
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
Since:
1.16
setShowSearchButton(bShowSearchButton): sap.m.SearchField

Sets a new value for property showSearchButton.

Set to true to show the search button with the magnifier icon. If false, both the search and refresh buttons are not displayed even if the "showRefreshButton" property is true.

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

Default value is true.

Parameters:
booleanbShowSearchButtonNew value for property showSearchButton
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
Since:
1.23
setValue(sValue): sap.m.SearchField

Sets a new value for property value.

Input Value.

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

Parameters:
stringsValueNew value for property value
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
setVisible(bVisible): sap.m.SearchField

Sets a new value for property visible.

Invisible inputs are not rendered.

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

Default value is true.

Parameters:
booleanbVisibleNew value for property visible
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
setWidth(sWidth): sap.m.SearchField

Sets a new value for property width.

Defines the CSS width of the input. If not set, width is 100%.

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

Parameters:
sap.ui.core.CSSSizesWidthNew value for property width
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
suggest(bShow): sap.m.SearchField
Toggle visibility of the suggestion list.
Parameters:
boolean|undefinedbShow

set to true to display suggestions and false to hide them. Default value is true. An empty suggestion list is not shown on desktop and tablet devices.

This method may be called only as a response to the suggest event to ensure that the suggestion list is shown at the moment when the user expects it.

Returns:
sap.m.SearchFieldthis to allow method chaining
Since:
1.34
unbindValue(): sap.m.SearchField
Unbinds property value from model data.
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
getSelectOnFocus(): boolean

Gets current value of property selectOnFocus.

Normally, search text is selected for copy when the SearchField is focused by keyboard navigation. If an application re-renders the SearchField during the liveChange event, set this property to false to disable text selection by focus.

Default value is true.

Returns:
booleanValue of property selectOnFocus
Deprecated API:
Since version 1.38. This parameter is deprecated and has no effect in run time. The cursor position of a focused search field is restored after re-rendering automatically.
Since:
1.20
getShowMagnifier(): boolean

Gets current value of property showMagnifier.

Set to false to hide the magnifier icon.

Default value is true.

Returns:
booleanValue of property showMagnifier
Deprecated API:
Since version 1.16.0. This parameter is deprecated. Use "showSearchButton" instead.
setSelectOnFocus(bSelectOnFocus): sap.m.SearchField

Sets a new value for property selectOnFocus.

Normally, search text is selected for copy when the SearchField is focused by keyboard navigation. If an application re-renders the SearchField during the liveChange event, set this property to false to disable text selection by focus.

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

Default value is true.

Parameters:
booleanbSelectOnFocusNew value for property selectOnFocus
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
Deprecated API:
Since version 1.38. This parameter is deprecated and has no effect in run time. The cursor position of a focused search field is restored after re-rendering automatically.
Since:
1.20
setShowMagnifier(bShowMagnifier): sap.m.SearchField

Sets a new value for property showMagnifier.

Set to false to hide the magnifier icon.

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

Default value is true.

Parameters:
booleanbShowMagnifierNew value for property showMagnifier
Returns:
sap.m.SearchFieldReference to this in order to allow method chaining
Deprecated API:
Since version 1.16.0. This parameter is deprecated. Use "showSearchButton" instead.