class sap.ui.comp.smartmultiedit.Field

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/comp/smartmultiedit/Field
Application Component: CA-UI5-SC

The SmartMultiEdit.Field control enables you to edit multiple homogeneous objects simultaneously. It allows you to select a predefined item from a combo box and apply your selection to all objects being edited.
In addition, SmartMultiEdit.Field can handle metadata for a specific OData property when you need to enable mass editing for multiple contexts. The contexts are handled by the sap.ui.comp.smartmultiedit.Container control.


Constructor

Constructor for a new sap.ui.comp.smartmultiedit.Field.

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.comp.smartmultiedit.Field(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
applyToEmptyOnly boolean false

Indicates whether to check for an existing value in the data model before applying the changes.
Please note that this property does not automatically update the model. It is up to you as the app developer to decide whether you want to consider this property when updating the model or not.

Visibility: public
description string

Optional description of the field.

Visibility: public
propertyName string

The OData property name to fetch metadata for.
Please note that this is not a dynamic SAP UI5 property: setting it twice will not result in a new binding.

Visibility: public
useApplyToEmptyOnly boolean false

Indicates whether to display applyToEmptyOnly flag.

Visibility: public
validateTokenExistence boolean true

Defines whether the existence of the selected token should be validated.
If you set this property to true, you should use the sap.ui.comp.smartmultiedit.Container#getErroneousFieldsAndTokens method, as the validation becomes asynchronous.

Since: 1.61.0.

Visibility: public

Aggregations

Default Aggregation:

Name Cardinality Type Description
configuration 0..1 sap.ui.comp.smartfield.Configuration

Optional configuration for SmartField.


Events Overview

Event Description
change

This event is fired when the selection focus moves from one item in the combo box to another.

change

This event is fired when the selection focus moves from one item in the combo box to another.

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
attachChange

Attaches event handler fnFunction to the change event of this sap.ui.comp.smartmultiedit.Field.

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.comp.smartmultiedit.Field itself.

This event is fired when the selection focus moves from one item in the combo box to another.

destroyConfiguration

Destroys the configuration in the aggregation configuration.

detachChange

Detaches event handler fnFunction from the change event of this sap.ui.comp.smartmultiedit.Field.

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

sap.ui.comp.smartmultiedit.Field.extend

Creates a new subclass of class sap.ui.comp.smartmultiedit.Field 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.

fireChange

Fires event change to attached listeners.

getApplyToEmptyOnly

Gets current value of property applyToEmptyOnly.

Indicates whether to check for an existing value in the data model before applying the changes.
Please note that this property does not automatically update the model. It is up to you as the app developer to decide whether you want to consider this property when updating the model or not.

Default value is false.

getConfiguration

Gets content of aggregation configuration.

Optional configuration for SmartField.

getDataType

Returns the data type used by the smart field. This data type is determined from metadata.

getDescription

Gets current value of property description.

Optional description of the field.

getLabel

Returns the label associated with this field.

sap.ui.comp.smartmultiedit.Field.getMetadata

Returns a metadata object for class sap.ui.comp.smartmultiedit.Field.

getNullable

Checks if the data type of the smart multi edit field is nullable as defined by its metadata.

getPropertyName

Gets current value of property propertyName.

The OData property name to fetch metadata for.
Please note that this is not a dynamic SAP UI5 property: setting it twice will not result in a new binding.

getRawValue

Returns the raw value for the OData property that is determined by the propertyName property. If the 'Keep existing value' item is selected, an empty plain object is returned.

getRecordTextPath

Returns the path to the text property used by the combo box.

getSelectedItem

Returns the item that was selected using the Select action.

getShowValueHelp

Checks if a sap.ui.comp.smartfield.SmartField is present, which provides a way to define an explicit value for the field.

getSmartField

Returns the smart field that is used for selecting a new value.

getUnitOfMeasure

Returns the unit of measurement for the underlying smart field.

getUnitOfMeasurePropertyName

Returns the name of the property used for the unit of measurement.

getUseApplyToEmptyOnly

Gets current value of property useApplyToEmptyOnly.

Indicates whether to display applyToEmptyOnly flag.

Default value is false.

getValidateTokenExistence

Gets current value of property validateTokenExistence.

Defines whether the existence of the selected token should be validated.
If you set this property to true, you should use the sap.ui.comp.smartmultiedit.Container#getErroneousFieldsAndTokens method, as the validation becomes asynchronous.

Default value is true.

getValue

Returns the current formatted value of the smart field. To get the raw value, use getRawValue instead.

hasClientError

Returns true if there is a client error present, false otherwise.

isBlankSelected

Checks if the 'Leave blank' item is selected.

isBoolean

Checks if the data type of the smart field is boolean.

isComboBox

Checks if the field uses a combo box. This check doesn't rely on data type but rather a certain combination of annotations.

isComposite

Checks if the data type of the smart field is unit of measurement (UOM).

isDate

Checks if the data type of the smart field is date.

isDateTime

Checks if the data type of the smart field is date with time.

isFloat

Checks if the data type of the smart field is some kind of a float number.

isInteger

Checks if the data type of the smart field is some kind of a integer number.

isKeepExistingSelected

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

isString

Checks if the data type of the smart field is string.

isTime

Checks if the data type of the smart field is time.

isValueHelpSelected

Checks if the 'Use Value Help' item is selected.

setApplyToEmptyOnly

Sets a new value for property applyToEmptyOnly.

Indicates whether to check for an existing value in the data model before applying the changes.
Please note that this property does not automatically update the model. It is up to you as the app developer to decide whether you want to consider this property when updating the model or not.

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

Default value is false.

setConfiguration

Sets the optional configuration aggregation.

setDescription

Sets a new value for property description.

Optional description of the field.

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

setPropertyName

Sets the name of the property to bind to.

setSelectedIndex

Sets the item to be selected in the sap.m.Select instance, using its index.

setSelectedItem

Sets the item to be treated as selected in the sap.m.Select instance.

setUseApplyToEmptyOnly

Sets a new value for property useApplyToEmptyOnly.

Indicates whether to display applyToEmptyOnly flag.

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

Default value is false.

setValidateTokenExistence

Sets a new value for property validateTokenExistence.

Defines whether the existence of the selected token should be validated.
If you set this property to true, you should use the sap.ui.comp.smartmultiedit.Container#getErroneousFieldsAndTokens method, as the validation becomes asynchronous.

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

Default value is true.

attachChange

Attaches event handler fnFunction to the change event of this sap.ui.comp.smartmultiedit.Field.

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.comp.smartmultiedit.Field itself.

This event is fired when the selection focus moves from one item in the combo box to another.

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.ui.comp.smartmultiedit.Field itself

destroyConfiguration

Destroys the configuration in the aggregation configuration.

detachChange

Detaches event handler fnFunction from the change event of this sap.ui.comp.smartmultiedit.Field.

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.ui.comp.smartmultiedit.Field.extend

Creates a new subclass of class sap.ui.comp.smartmultiedit.Field 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.

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.

getApplyToEmptyOnly

Gets current value of property applyToEmptyOnly.

Indicates whether to check for an existing value in the data model before applying the changes.
Please note that this property does not automatically update the model. It is up to you as the app developer to decide whether you want to consider this property when updating the model or not.

Default value is false.

getConfiguration

Gets content of aggregation configuration.

Optional configuration for SmartField.

getDataType

Returns the data type used by the smart field. This data type is determined from metadata.

getDescription

Gets current value of property description.

Optional description of the field.

getLabel

Returns the label associated with this field.

sap.ui.comp.smartmultiedit.Field.getMetadata

Returns a metadata object for class sap.ui.comp.smartmultiedit.Field.

getNullable

Checks if the data type of the smart multi edit field is nullable as defined by its metadata.

getPropertyName

Gets current value of property propertyName.

The OData property name to fetch metadata for.
Please note that this is not a dynamic SAP UI5 property: setting it twice will not result in a new binding.

getRawValue

Returns the raw value for the OData property that is determined by the propertyName property. If the 'Keep existing value' item is selected, an empty plain object is returned.

getRecordTextPath

Returns the path to the text property used by the combo box.

getSelectedItem

Returns the item that was selected using the Select action.

getShowValueHelp

Checks if a sap.ui.comp.smartfield.SmartField is present, which provides a way to define an explicit value for the field.

getSmartField

Returns the smart field that is used for selecting a new value.

getUnitOfMeasure

Returns the unit of measurement for the underlying smart field.

getUnitOfMeasurePropertyName

Returns the name of the property used for the unit of measurement.

getUseApplyToEmptyOnly

Gets current value of property useApplyToEmptyOnly.

Indicates whether to display applyToEmptyOnly flag.

Default value is false.

getValidateTokenExistence

Gets current value of property validateTokenExistence.

Defines whether the existence of the selected token should be validated.
If you set this property to true, you should use the sap.ui.comp.smartmultiedit.Container#getErroneousFieldsAndTokens method, as the validation becomes asynchronous.

Default value is true.

getValue

Returns the current formatted value of the smart field. To get the raw value, use getRawValue instead.

hasClientError

Returns true if there is a client error present, false otherwise.

isBlankSelected

Checks if the 'Leave blank' item is selected.

isBoolean

Checks if the data type of the smart field is boolean.

isComboBox

Checks if the field uses a combo box. This check doesn't rely on data type but rather a certain combination of annotations.

isComposite

Checks if the data type of the smart field is unit of measurement (UOM).

isDate

Checks if the data type of the smart field is date.

isDateTime

Checks if the data type of the smart field is date with time.

isFloat

Checks if the data type of the smart field is some kind of a float number.

isInteger

Checks if the data type of the smart field is some kind of a integer number.

isKeepExistingSelected

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

isString

Checks if the data type of the smart field is string.

isTime

Checks if the data type of the smart field is time.

isValueHelpSelected

Checks if the 'Use Value Help' item is selected.

setApplyToEmptyOnly

Sets a new value for property applyToEmptyOnly.

Indicates whether to check for an existing value in the data model before applying the changes.
Please note that this property does not automatically update the model. It is up to you as the app developer to decide whether you want to consider this property when updating the model or not.

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

New value for property applyToEmptyOnly

setConfiguration

Sets the optional configuration aggregation.

Param Type DefaultValue Description
oConfig sap.ui.comp.smartfield.Configuration

Optional configuration to set.

setDescription

Sets a new value for property description.

Optional description of the field.

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

Param Type DefaultValue Description
sDescription string

New value for property description

setPropertyName

Sets the name of the property to bind to.

Param Type DefaultValue Description
sName string

Name of the property to bind to.

setSelectedIndex

Sets the item to be selected in the sap.m.Select instance, using its index.

Param Type DefaultValue Description
iIndex number

An index of the item inside the Select action.

setSelectedItem

Sets the item to be treated as selected in the sap.m.Select instance.

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

An sap.ui.core.Item instance or null.

setUseApplyToEmptyOnly

Sets a new value for property useApplyToEmptyOnly.

Indicates whether to display applyToEmptyOnly flag.

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

New value for property useApplyToEmptyOnly

setValidateTokenExistence

Sets a new value for property validateTokenExistence.

Defines whether the existence of the selected token should be validated.
If you set this property to true, you should use the sap.ui.comp.smartmultiedit.Container#getErroneousFieldsAndTokens method, as the validation becomes asynchronous.

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

New value for property validateTokenExistence