class sap.m.SuggestionItem

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

Display suggestion list items.

Note: The inherited enabled property is not supported. If an item shouldn't be selected, remove it from the list instead.


Constructor

Constructor for a new SuggestionItem.

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.SuggestionItem(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
description string empty string

Additional text of type string, optionally to be displayed along with this item.

Visibility: public
enabled boolean true

The property should not be used in sap.m.SearchField's items.

Visibility: hidden
icon string empty string

The icon belonging to this list item instance. This can be a URI to an image or an icon font URI.

Visibility: public

Methods Overview

Method Description
sap.m.SuggestionItem.extend

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

getDescription

Gets current value of property description.

Additional text of type string, optionally to be displayed along with this item.

Default value is empty string.

getIcon

Gets current value of property icon.

The icon belonging to this list item instance. This can be a URI to an image or an icon font URI.

Default value is empty string.

sap.m.SuggestionItem.getMetadata

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

getSuggestionText

Return suggestion text. By default, it is the value of the text property.

Subclasses may override this function.

render

Produces the HTML of the suggestion item and writes it to render-output-buffer.

Subclasses may override this function.

setDescription

Sets a new value for property description.

Additional text of type string, optionally to be displayed along with this item.

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

Default value is empty string.

setIcon

Sets a new value for property icon.

The icon belonging to this list item instance. This can be a URI to an image or an icon font URI.

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

Default value is empty string.

sap.m.SuggestionItem.extend

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

getDescription

Gets current value of property description.

Additional text of type string, optionally to be displayed along with this item.

Default value is empty string.

getIcon

Gets current value of property icon.

The icon belonging to this list item instance. This can be a URI to an image or an icon font URI.

Default value is empty string.

sap.m.SuggestionItem.getMetadata

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

getSuggestionText

Return suggestion text. By default, it is the value of the text property.

Subclasses may override this function.

render

Produces the HTML of the suggestion item and writes it to render-output-buffer.

Subclasses may override this function.

Param Type DefaultValue Description
oRM sap.ui.core.RenderManager

The RenderManager

oItem sap.m.SuggestionItem

The item which should be rendered

sSearch string

The search text that should be emphasized

bSelected boolean

The item is selected

setDescription

Sets a new value for property description.

Additional text of type string, optionally to be displayed along with this item.

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
sDescription string ""

New value for property description

setIcon

Sets a new value for property icon.

The icon belonging to this list item instance. This can be a URI to an image or an icon font URI.

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
sIcon string ""

New value for property icon