class sap.ui.mdc.field.ListFieldHelp

Visiblity: restricted
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/mdc/field/ListFieldHelp
Application Component: CA-UI5-MDC

A field help used in the FieldHelp association of controls based on FieldBase that shows a list of items.


Constructor

Constructor for a new ListFieldHelp.

This field help supports only single selection.

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.ui.mdc.field.ListFieldHelp(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
filterList boolean true

If set, the items of the list are filtered based on filterValue.

If a type-ahead behavior for the connected field is wanted, this property must be set to true. For small lists all values are meant to be shown, independent of the typing in the connected field. In this case this property must be set to false.

If not set, the list opens if the user clicks into the connected field.

Since: 1.81.0.

Visibility: public
useFirstMatch boolean false

If set, getKeyForText returns the first item that matches the text.

This is the case if the text of the item starts with the text entered.

Since: 1.81.0.

Visibility: public

Borrowed Properties

Name Type Default Value Description
conditions object[]

The conditions of the selected items.

Note: This property must only be set by the control the FieldHelp element belongs to, not by the application.

Note: A condition must have the structure of ConditionObject.

Visibility: public
delegate object ...see text or source

Defines the module path of the metadata delegate.

Visibility: public
filterValue string empty string

The value by which the help is filtered.

Note: This only takes effect if the FieldHelp element supports filtering.

Note: This property must only be set by the control the FieldHelp element belongs to, not by the application.

Visibility: public
validateInput boolean true

If this property is set, the user input is validated against the field help. If no entry is found for the user input, an error occurs.

If this property is not set, the user input is still checked against the field help. But if no entry is found, the user input is set to the field if the used data type allows this. (A type parsing error is shown if the user input adheres to the requirements of the used data type.)

Since: 1.69.0.

Visibility: public
delegate object

Path to the Delegate module that provides the required APIs to execute model-specific logic.
Note: Ensure that the related file can be requested (any required library has to be loaded before that).
Do not bind or modify the module. This property can only be configured during control initialization.

Visibility: public

Aggregations

Default Aggregation: items

Name Cardinality Type Description
items (default) 0..n sap.ui.core.ListItem

Items of the field help.

The key of the items is not shown in the list, but is used as a value of the connected field.

If the additionalText for all the items is not used, the column will not be displayed.

Note: At the moment, icons are not supported.

Note: If ListFieldHelpItem elements are used as items, the items are grouped and sorted by the value provided in the groupKey property of the item. The value provided in the groupText property will be shown as group header.


Methods Overview

Method Description
addItem

Adds some item to the aggregation items.

destroyItems

Destroys all the items in the aggregation items.

sap.ui.mdc.field.ListFieldHelp.extend

Creates a new subclass of class sap.ui.mdc.field.ListFieldHelp 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.mdc.field.FieldHelpBase.extend.

getFilterList

Gets current value of property filterList.

If set, the items of the list are filtered based on filterValue.

If a type-ahead behavior for the connected field is wanted, this property must be set to true. For small lists all values are meant to be shown, independent of the typing in the connected field. In this case this property must be set to false.

If not set, the list opens if the user clicks into the connected field.

Default value is true.

getItems

Gets content of aggregation items.

Items of the field help.

The key of the items is not shown in the list, but is used as a value of the connected field.

If the additionalText for all the items is not used, the column will not be displayed.

Note: At the moment, icons are not supported.

Note: If ListFieldHelpItem elements are used as items, the items are grouped and sorted by the value provided in the groupKey property of the item. The value provided in the groupText property will be shown as group header.

sap.ui.mdc.field.ListFieldHelp.getMetadata

Returns a metadata object for class sap.ui.mdc.field.ListFieldHelp.

getUseFirstMatch

Gets current value of property useFirstMatch.

If set, getKeyForText returns the first item that matches the text.

This is the case if the text of the item starts with the text entered.

Default value is false.

indexOfItem

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

insertItem

Inserts a item into the aggregation items.

removeAllItems

Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

removeItem

Removes a item from the aggregation items.

setFilterList

Sets a new value for property filterList.

If set, the items of the list are filtered based on filterValue.

If a type-ahead behavior for the connected field is wanted, this property must be set to true. For small lists all values are meant to be shown, independent of the typing in the connected field. In this case this property must be set to false.

If not set, the list opens if the user clicks into the connected field.

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

Default value is true.

setUseFirstMatch

Sets a new value for property useFirstMatch.

If set, getKeyForText returns the first item that matches the text.

This is the case if the text of the item starts with the text entered.

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

Default value is false.

addItem

Adds some item to the aggregation items.

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

The item to add; if empty, nothing is inserted

destroyItems

Destroys all the items in the aggregation items.

sap.ui.mdc.field.ListFieldHelp.extend

Creates a new subclass of class sap.ui.mdc.field.ListFieldHelp 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.mdc.field.FieldHelpBase.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

getFilterList

Gets current value of property filterList.

If set, the items of the list are filtered based on filterValue.

If a type-ahead behavior for the connected field is wanted, this property must be set to true. For small lists all values are meant to be shown, independent of the typing in the connected field. In this case this property must be set to false.

If not set, the list opens if the user clicks into the connected field.

Default value is true.

getItems

Gets content of aggregation items.

Items of the field help.

The key of the items is not shown in the list, but is used as a value of the connected field.

If the additionalText for all the items is not used, the column will not be displayed.

Note: At the moment, icons are not supported.

Note: If ListFieldHelpItem elements are used as items, the items are grouped and sorted by the value provided in the groupKey property of the item. The value provided in the groupText property will be shown as group header.

sap.ui.mdc.field.ListFieldHelp.getMetadata

Returns a metadata object for class sap.ui.mdc.field.ListFieldHelp.

getUseFirstMatch

Gets current value of property useFirstMatch.

If set, getKeyForText returns the first item that matches the text.

This is the case if the text of the item starts with the text entered.

Default value is false.

indexOfItem

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

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

The item whose index is looked for

insertItem

Inserts a item into the aggregation items.

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

The item to insert; if empty, nothing is inserted

iIndex int

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

removeAllItems

Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

removeItem

Removes a item from the aggregation items.

Param Type DefaultValue Description
vItem int string sap.ui.core.ListItem

The item to remove or its index or id

setFilterList

Sets a new value for property filterList.

If set, the items of the list are filtered based on filterValue.

If a type-ahead behavior for the connected field is wanted, this property must be set to true. For small lists all values are meant to be shown, independent of the typing in the connected field. In this case this property must be set to false.

If not set, the list opens if the user clicks into the connected field.

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
bFilterList boolean true

New value for property filterList

setUseFirstMatch

Sets a new value for property useFirstMatch.

If set, getKeyForText returns the first item that matches the text.

This is the case if the text of the item starts with the text entered.

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
bUseFirstMatch boolean false

New value for property useFirstMatch