class sap.m.MultiEditField

Control sample: sap.m.MultiEditField
Visiblity: restricted
UX Guidelines:
Implements: sap.ui.core.IFormContent
Available since: N/A
Module: sap/m/MultiEditField
Application Component: CA-UI5-SC

This control allows you to add items to a sap.m.Select instance. In addition, based on the property set, a set of pre-filled entries is added.


Constructor

Constructor for MultiEditField

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.MultiEditField(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
nullable boolean true

Defines whether the 'Leave blank' item should be available in the selection field.

Visibility: public
required boolean false

Defines whether the 'Label' is required for the selection field.

Visibility: public
selectedItem sap.ui.core.Item

The selected item from items aggregation. This can be null if no valid item or special item is selected.

Visibility: public
showValueHelp boolean true

Defines whether the 'Select new value' item should be available in the selection field. Please note that upon selecting this item, the previously selected item is restored. As a consequence, the selectedItem property never contains this item.

Visibility: public

Aggregations

Default Aggregation:

Name Cardinality Type Description
items 0..n sap.ui.core.Item

The items that should be displayed after the predefined special items in the selection field.


Associations

Name Cardinality Type Description
ariaLabelledBy 0..n sap.ui.core.Control

The label that should be displayed before the field.


Events Overview

Event Description
change

This event is fired when the item of items aggregation in the selection field is changed.

change

This event is fired when the item of items aggregation in the selection field is changed.

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

The selected item.


Methods Overview

Method Description
addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

addItem

Adds some item to the aggregation items.

attachChange

Attaches event handler fnFunction to the change event of this sap.m.MultiEditField.

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

This event is fired when the item of items aggregation in the selection field is changed.

bindItems

Binds aggregation items to model data.

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

destroyItems

Destroys all the items in the aggregation items.

detachChange

Detaches event handler fnFunction from the change event of this sap.m.MultiEditField.

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

sap.m.MultiEditField.extend

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

fireChange

Fires event change to attached listeners.

getAriaLabelledBy

Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.

getFormDoNotAdjustWidth

The field is not adjusted by the Form control to meet the cell's width

getItems

Gets content of aggregation items.

The items that should be displayed after the predefined special items in the selection field.

sap.m.MultiEditField.getMetadata

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

getNullable

Gets current value of property nullable.

Defines whether the 'Leave blank' item should be available in the selection field.

Default value is true.

getRequired

Gets current value of property required.

Defines whether the 'Label' is required for the selection field.

Default value is false.

getSelectedItem

Gets current value of property selectedItem.

The selected item from items aggregation. This can be null if no valid item or special item is selected.

getShowValueHelp

Gets current value of property showValueHelp.

Defines whether the 'Select new value' item should be available in the selection field. Please note that upon selecting this item, the previously selected item is restored. As a consequence, the selectedItem property never contains this item.

Default value is true.

indexOfItem

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

insertItem

Inserts a item into the aggregation items.

isBlankSelected

Checks if the 'Leave blank' item is selected.

isKeepExistingSelected

Checks if the 'Keep existing value' item is selected.

removeAllAriaLabelledBy

Removes all the controls in the association named ariaLabelledBy.

removeAllItems

Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

removeAriaLabelledBy

Removes an ariaLabelledBy from the association named ariaLabelledBy.

removeItem

Removes a item from the aggregation items.

resetSelection

Sets the previously selected item as the currently selected item of the internal select control.

setNullable

Sets a new value for property nullable.

Defines whether the 'Leave blank' item should be available in the selection field.

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

Default value is true.

setRequired

Sets a new value for property required.

Defines whether the 'Label' is required for the selection field.

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

Default value is false.

setSelectedItem

Sets a new value for property selectedItem.

The selected item from items aggregation. This can be null if no valid item or special item is selected.

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

setShowValueHelp

Sets a new value for property showValueHelp.

Defines whether the 'Select new value' item should be available in the selection field. Please note that upon selecting this item, the previously selected item is restored. As a consequence, the selectedItem property never contains this item.

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

Default value is true.

unbindItems

Unbinds aggregation items from model data.

addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

Param Type DefaultValue Description
vAriaLabelledBy sap.ui.core.ID sap.ui.core.Control

The ariaLabelledBy to add; if empty, nothing is inserted

addItem

Adds some item to the aggregation items.

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

The item to add; if empty, nothing is inserted

attachChange

Attaches event handler fnFunction to the change event of this sap.m.MultiEditField.

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

This event is fired when the item of items aggregation in the selection field is changed.

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

bindItems

Binds aggregation items 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

destroyItems

Destroys all the items in the aggregation items.

detachChange

Detaches event handler fnFunction from the change event of this sap.m.MultiEditField.

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.MultiEditField.extend

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

fireChange

Fires event change to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

selectedItem sap.ui.core.Item

The selected item.

getAriaLabelledBy

Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.

getFormDoNotAdjustWidth

The field is not adjusted by the Form control to meet the cell's width

getItems

Gets content of aggregation items.

The items that should be displayed after the predefined special items in the selection field.

sap.m.MultiEditField.getMetadata

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

getNullable

Gets current value of property nullable.

Defines whether the 'Leave blank' item should be available in the selection field.

Default value is true.

getRequired

Gets current value of property required.

Defines whether the 'Label' is required for the selection field.

Default value is false.

getSelectedItem

Gets current value of property selectedItem.

The selected item from items aggregation. This can be null if no valid item or special item is selected.

getShowValueHelp

Gets current value of property showValueHelp.

Defines whether the 'Select new value' item should be available in the selection field. Please note that upon selecting this item, the previously selected item is restored. As a consequence, the selectedItem property never contains this item.

Default value is true.

indexOfItem

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

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

The item whose index is looked for

insertItem

Inserts a item into the aggregation items.

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

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

isBlankSelected

Checks if the 'Leave blank' item is selected.

isKeepExistingSelected

Checks if the 'Keep existing value' item is selected.

removeAllAriaLabelledBy

Removes all the controls in the association named ariaLabelledBy.

removeAllItems

Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

removeAriaLabelledBy

Removes an ariaLabelledBy from the association named ariaLabelledBy.

Param Type DefaultValue Description
vAriaLabelledBy int sap.ui.core.ID sap.ui.core.Control

The ariaLabelledBy to be removed or its index or ID

removeItem

Removes a item from the aggregation items.

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

The item to remove or its index or id

resetSelection

Sets the previously selected item as the currently selected item of the internal select control.

setNullable

Sets a new value for property nullable.

Defines whether the 'Leave blank' item should be available in the selection 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
bNullable boolean true

New value for property nullable

setRequired

Sets a new value for property required.

Defines whether the 'Label' is required for the selection field.

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

New value for property required

setSelectedItem

Sets a new value for property selectedItem.

The selected item from items aggregation. This can be null if no valid item or special item is selected.

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

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

New value for property selectedItem

setShowValueHelp

Sets a new value for property showValueHelp.

Defines whether the 'Select new value' item should be available in the selection field. Please note that upon selecting this item, the previously selected item is restored. As a consequence, the selectedItem property never contains this item.

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

New value for property showValueHelp

unbindItems

Unbinds aggregation items from model data.