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 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 |
Name | Type | Default Value | Description |
---|---|---|---|
applyToEmptyOnly | boolean | false | Indicates whether to check for an existing value in the data model before applying the changes. |
description | string | Optional description of the field. Visibility: public |
|
propertyName | string | The OData property name to fetch metadata for. |
|
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. |
Default Aggregation:
Name | Cardinality | Type | Description |
---|---|---|---|
configuration | 0..1 | sap.ui.comp.smartfield.Configuration |
Optional configuration for |
Event | Description |
---|---|
change |
This event is fired when the selection focus moves from one item in the combo box to another. |
Method | Description |
---|---|
attachChange |
Attaches event handler When called, the context of the event handler (its 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 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
|
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. Default value is |
getConfiguration |
Gets content of aggregation configuration. Optional configuration for |
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. |
getRawValue |
Returns the raw value for the OData property that is determined by the |
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 |
getValidateTokenExistence |
Gets current value of property validateTokenExistence. Defines whether the existence of the selected token should be validated. Default value is |
getValue |
Returns the current formatted value of the smart field. To get the raw value, use |
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. When called with a value of Default value is |
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 |
setPropertyName |
Sets the name of the property to bind to. |
setSelectedIndex |
Sets the item to be selected in the |
setSelectedItem |
Sets the item to be treated as selected in the |
setUseApplyToEmptyOnly |
Sets a new value for property useApplyToEmptyOnly. Indicates whether to display applyToEmptyOnly flag. When called with a value of Default value is |
setValidateTokenExistence |
Sets a new value for property validateTokenExistence. Defines whether the existence of the selected token should be validated. When called with a value of Default value is |
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 |
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 |
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 |
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. |
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
.
Returns the data type used by the smart field. This data type is determined from metadata.
Returns a metadata object for class sap.ui.comp.smartmultiedit.Field.
Checks if the data type of the smart multi edit field is nullable as defined by its metadata.
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.
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.
Checks if a sap.ui.comp.smartfield.SmartField is present, which provides a way to define an explicit value for the field.
Gets current value of property useApplyToEmptyOnly.
Indicates whether to display applyToEmptyOnly flag.
Default value is false
.
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
.
Returns the current formatted value of the smart field. To get the raw value, use getRawValue
instead.
Checks if the field uses a combo box. This check doesn't rely on data type but rather a certain combination of annotations.
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 |
Sets the optional configuration aggregation.
Param | Type | DefaultValue | Description |
---|---|---|---|
oConfig | sap.ui.comp.smartfield.Configuration |
Optional configuration to set. |
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 |
Sets the name of the property to bind to.
Param | Type | DefaultValue | Description |
---|---|---|---|
sName | string |
Name of the property to bind to. |
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. |
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 |
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 |
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 |