class sap.ui.comp.smartmultiinput.SmartMultiInput

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

The SmartMultiInput control is a wrapper for other controls that extends the sap.ui.comp.smartfield.SmartField control and supports the same settings and annotations.
It interprets OData metadata to create multi-input controls, such as sap.m.MultiInput and sap.m.MultiComboBox.
The OData entity property that is changed or displayed in the control is derived from the control's value property. You can use the SmartMultiInput control in two ways:

Both cases are shown in the example bellow as well as in the samples. Tokens selected in SmartMultiInput can be retrieved using either the #getTokens or the #getValue method.

<sap.ui.comp.smartmultiinput.SmartMultiInput value="{Categories/CategoryId}"/>
<sap.ui.comp.smartmultiinput.SmartMultiInput entitySet="Categories" value="{CategoryId}"/>

For more details, see the samples .

Note: Just as the rest of the sap.ui.comp library, this control supports only OData V2 (see sap.ui.model.odata.v2.ODataModel) and default models.


Constructor

Constructor for a new sap.ui.comp.smartfield.SmartMultiInput.

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.smartmultiinput.SmartMultiInput(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
enableODataSelect boolean false

Enables specific properties to be provided in the select query.

Visibility: public
requestAtLeastFields string empty string

Enables requestAtLeast properties to be added additionally when enableODataSelect is set to True. These are comma-separated value of fields that must be requested from the backend.

Visibility: public
supportMultiSelect boolean true

Enables multiple selection in value help dialog.

Visibility: public
supportRanges boolean false

Enables value help with conditions. Can only be used without binding context. Otherwise, has no effect.

Visibility: public
textSeparator string

Denotes the separator between texts in the display mode. The default value is loaded from the component resource bundle.

Visibility: public

Borrowed Properties

Name Type Default Value Description
clientSideMandatoryCheck boolean true

Determines if the mandatory check happens on the client side true or on the server side false.

Note: If the sap.ui.comp.smartfield.SmartField#value property of the SmartField control is bound to an Entity Data Model (EDM) property annotated as Nullable="false", the mandatory validation is performed on the client side regardless of the clientSideMandatoryCheck setting.

Example:

    <Property Name="CategoryID" Type="Edm.String" Nullable="false"/>


Since: 1.38.3.

Visibility: public
contextEditable boolean true

Notifies the control whether controls using the SmartField control are editable.

Since: 1.32.0.

Visibility: public
controlContext sap.ui.comp.smartfield.ControlContextType None

Defines the context in which the layout of the SmartField control has to be interpreted.

Since: 1.32.0.

Visibility: public
editable boolean true

Indicates whether the control is in display or edit mode.

Note: The SmartField control is metadata-driven, and this control property can be ignored if the following applies:

  • The bound Entity Data Model (EDM) property or its entity set are annotated with the OData V2 sap:updatable annotation.
  • The bound EDM property or its entity set are annotated with the sap:creatable annotation.
  • The entity set of the bound EDM property is annotated with the OData V2 sap:updatable-path annotation.
  • The entity set of the bound EDM property is annotated with the OData V4 Org.OData.Capabilities.V1.InsertRestrictions annotation.
  • The bound EDM property is annotated with the com.sap.vocabularies.Common.v1.FieldControl annotation.
  • The entity set of the bound EDM property is annotated with the OData V4 Org.OData.Capabilities.V1.UpdateRestrictions annotation.

Visibility: public
enabled boolean true

Indicates whether the user can interact with the control or not. Note: Disabled controls cannot be focused and they are out of the tab order.

Visibility: public
entitySet string empty string

The name of an entity set for which the control manages values. This is an optional property.

If this property is left empty, the entity set is computed by parsing the binding context path, for example, Tasks('id-1428419016778-51') is parsed to Tasks.

Visibility: public
expandNavigationProperties boolean false

Indicates if entities related to navigation properties inside the metadata are requested. If set to true, then these related entities are loaded with an $expand request.

Annotations that can have navigation properties are the following:

  • com.sap.vocabularies.Common.v1.Text for text arrangements
  • Org.OData.Measures.V1.Unit and Org.OData.Measures.V1.ISOCurrency for units
  • com.sap.vocabularies.Common.v1.FieldControl for field control

Note: Independent of the fetchValueListReadOnly value, setting this flag to true requests data from the backend.

Note: The back-end request to expand the navigation properties is sent only if the entity to which SmartField is bound is persisted. For transient entities, there is no back-end request since no such data is available.

Since: 1.48.

Visibility: public
fetchValueListReadOnly boolean true

Indicates whether the value list collection is fetched in display mode from the resource path specified in the com.sap.vocabularies.Common.v1.ValueList annotation.

This collection data is used to infer a descriptive text for the value of the SmartField control. However, fetching the value list collection for every SmartField instance individually may not be ideal in some performance-critical scenarios. To optimize this default behavior, you can set this property to false and provide the com.sap.vocabularies.Common.v1.Text annotation, which is used to specify the URL path name to the Entity Data Model (EDM) property from which the descriptive text for the value of the SmartField control is fetched, for example, LT (Laptop).

Note: Setting this property to false only has an effect if the value property of the SmartField control is bound to an Entity Data Model (EDM) property typed as Edm.String. In addition, applications or frameworks have to make sure the descriptive text is fetched, for example, by expanding a navigation property.

Since: 1.42.0.

Visibility: public
fixedValueListValidationEnabled boolean false

If the property is set to true, a standard validation for sap.m.ComboBox is performed. An inner control sap.m.ComboBox is created and the binding is to selectedKey. Changes at runtime are not reflected.

Note: If the property is set to false, the inner control is sap.ui.comp.smartfield.ComboBox and the binding is to enteredValue. In this case, any entered value is valid irrespective of whether it's in the predefined list or not.

Note: This property is applicable only for fixed-value scenarios.

Since: 1.88.

Visibility: public
historyEnabled boolean true

If the property is set to false, history values are disabled. Changes at runtime are not reflected. The historyEnabled property is not applied to custom controls.

Note: For sap.m.ComboBox and sap.m.MultiComboBox the history values are disabled by default. To enable them for these controls, you need to set the historyEnabled property to true.

Since: 1.84.

Visibility: public
importance sap.ui.comp.smartfield.Importance Low

Specifies the importance of the field. Applicable only when the SmartField is used inside SmartForm.

Since: 1.87.

Visibility: public
jsontype sap.ui.comp.smartfield.JSONType

Data types to be used, if the SmartField control is interacting with a JSON model. If the value property of the control is bound to a property of an OData entity set, this property is not taken into consideration.

Visibility: public
mandatory boolean false

Indicates whether user input is required.

Note: The SmartField control is metadata-driven and this property can be ignored if the following applies:

  • The bound Entity Data Model (EDM) property is annotated with the Nullable annotation. The Nullable annotation is a capability of the OData service that specifies whether a value is mandatory, hence it overrules the control's API settings. Therefore, if the Nullable attribute is specified as Nullable="false", a value is mandatory.
  • The bound EDM property is annotated with the com.sap.vocabularies.Common.v1.FieldControl annotation.

Visibility: public
maxLength int 0

Defines the highest possible number of permitted input characters that the user can enter into the text input field.

Computed maxLength

If the specified maxLength value is greater than the maxLength value specified for the underlying bound Entity Data Model (EDM) property in the service metadata document, the maxLength value of the EDM property takes precedence. Likewise, if the application code provides a binding data type for the value property of the SmartField control and the binding data type has maxLength constraints defined, this maxLength is also taken into consideration to compute the final maxLength value.

Validation Behavior

By design, the SmartField control does not restrict/validate the highest number of permitted input characters for every keystroke, but only when the text input field has changed, and the browser focus leaves the text input field or the ENTER key is pressed. The SmartField control is used more generically in broader contexts, and adding a maxLength attribute to the HTML text input control may break data type formatting in two-way data-binding scenarios. Let's say the maxLength property is set to 3, but the text input control has a formatter function attached to it to format the entered value "DE" to "Germany (DE)". In this case, the formatted value will be truncated by the maxLength setting.

Visibility: public
name string empty string

To be used in the HTML code (for example, for HTML forms that send data to the server via 'submit').

Visibility: public
placeholder string empty string

Text shown when no value available.

Visibility: public
proposedControl sap.ui.comp.smartfield.ControlProposalType None

Proposes a control to be rendered. The SmartField control can ignore the proposal.

Since: 1.32.0.

Visibility: public
showLabel boolean true

If set to false the label is not displayed.

Visibility: public
showSuggestion boolean true

If set to true, the suggestion feature for a hosted control is enabled, if the hosted control supports it.

Visibility: public
showValueHelp boolean true

If set to true, a value help indicator will be displayed inside the hosted control, if the hosted control supports this.

Visibility: public
showValueStateMessage boolean true

Defines whether the value state message is shown or not.

Visibility: public
textAlign sap.ui.core.TextAlign Initial

Horizontal alignment of the text.

Visibility: public
textDirection sap.ui.core.TextDirection Inherit

The available text direction options are LTR and RTL. By default, the control inherits the text direction from its parent control.

The textDirection property can be used when, for example, the text direction in the application is LTR but you want a specific field to have RTL text direction.

Note: The textDirection property is not applicable for the SmartField control for units of measure use cases.

Since: 1.86.0.

Visibility: public
textInEditModeSource sap.ui.comp.smartfield.TextInEditModeSource None

Sets the source from which text descriptions for IDs are fetched in edit mode, for example, for LT (Laptop).

Note: The sap.ui.comp.smartfield.TextInEditModeSource.NavigationProperty and sap.ui.comp.smartfield.TextInEditModeSource.ValueList enumeration members are only supported if the following applies:

  • The value property of the SmartField control instance is bound to an Entity Data Model (EDM) property typed as Edm.String or Edm.Guid.
  • The com.sap.vocabularies.UI.v1.TextArrangement annotation for the bound EDM property or entity type is specified in the service metadata document or annotation file.
  • The binding mode for the value property of the SmartField control is the two-way binding mode.
  • The field from which the description is fetched is filterable.

Note: In addition, the sap.ui.comp.smartfield.TextInEditModeSource.NavigationProperty enumeration member is only supported if the following applies:

  • The EDM navigation property association is defined in the service metadata document.
  • The com.sap.vocabularies.Common.v1.Text annotation for the bound EDM property is specified in the service metadata document or annotation file whose Path attribute points to a EDM navigation property of a lookup entity set/type whose single key property is the ID, which contains (among other properties) the descriptive value.
  • The lookup entity must be loaded. The lookup entity can be loaded by expanding the EDM navigation property via a $expand query parameter.
  • The EDM navigation property association defines a referential constraint that ties values of the dependent editable entity type/set to the lookup entity type/set in the service metadata document.
  • The EDM navigation property association end multiplicity of the lookup entity type/set is defined as 1 in the service metadata document. There must be a single-valued navigation from the editable entity set/type to the lookup entity set/type.
  • The lookup entity type/set from which the descriptive value is fetched contains a single-key EDM property.

Note: As of version 1.82, if SmartField is used inside a SmartForm, defaultTextInEditModeSource can be added as custom data to the form and it will be propagated to all smart fields that cover the above criteria. However, if textInEditModeSource is added to the SmartField as property, it will override the defaultTextInEditModeSource propagated from the SmartForm custom data.

Since: 1.83.

Visibility: public
textLabel string empty string

This property contains the text of an associated SmartLabel.

Visibility: public
tooltipLabel string empty string

This property contains the tool tip of the associated SmartLabel control.

Visibility: public
uomEditState int -1

This property is for internal use only.

Since: 1.32.0.

Visibility: public
uomEditable boolean true

Indicates whether the unit of measure field is in display or edit mode.

Note: This control property is only valid if the SmartField control addresses a unit of measure composite field, for example, an amount field and its associated currency field. The field must then be annotated with one of the following annotations:

  • The bound Entity Data Model (EDM) property or its entity set are annotated with the OData V2 sap:unit annotation.
  • The entity set of the bound EDM property is annotated with the OData V4 Org.OData.Measures.V1.ISOCurrency annotation.
  • The entity set of the bound EDM property is annotated with the OData V4 Org.OData.Measures.V1.Unit annotation.

Note: The SmartField control is metadata-driven, and this control property can be ignored if the following applies:

  • The bound Entity Data Model (EDM) property or its entity set are annotated with the OData V2 sap:updatable annotation.
  • The bound EDM property or its entity set are annotated with the sap:creatable annotation.
  • The entity set of the bound EDM property is annotated with the OData V2 sap:updatable-path annotation.
  • The entity set of the bound EDM property is annotated with the OData V4 Org.OData.Capabilities.V1.InsertRestrictions annotation.
  • The bound EDM property is annotated with the com.sap.vocabularies.Common.v1.FieldControl annotation.
  • The entity set of the bound EDM property is annotated with the OData V4 Org.OData.Capabilities.V1.UpdateRestrictions annotation.

Visibility: public
uomEnabled boolean true

Enabled state of the unit, if the SmartField control addresses unit of measure use cases, for example, an amount and its associated currency.

Visibility: public
uomVisible boolean true

Indicates whether the unit of measure field is visible.

Note: This control property is only valid if the SmartField control addresses a unit of measure composite field, for example, an amount field and its associated currency field. The field must then be annotated with one of the following annotations:

  • The bound Entity Data Model (EDM) property or its entity set are annotated with the OData V2 sap:unit annotation.
  • The entity set of the bound EDM property is annotated with the OData V4 Org.OData.Measures.V1.ISOCurrency annotation.
  • The entity set of the bound EDM property is annotated with the OData V4 Org.OData.Measures.V1.Unit annotation.

Note: The SmartField control is metadata-driven, and this property can be ignored if the bound EDM property is annotated with the com.sap.vocabularies.Common.v1.FieldControl annotation.

Visibility: public
url string empty string

Contains a URL which is used to render a link. The link is rendered, if the OData property, to which the value property of the control is bound, is of type Edm.String and the SmartField is in display mode.

Visibility: public
value any

The binding path expression used to determine the bound Entity Data Model (EDM) property.

Note: Composite binding expressions for this property are not supported. Note: Custom formatters for this property are not supported. The SmartField control usually creates its own data type based on the service metadata for the formatting of values. Also, when a custom formatter is specified for a property, the binding mode is automatically switched to one-way binding mode. Note: Named models are not supported, only the default model (named undefined) is supported. For example, when the binding path expression contains a > sign, the string preceding it is a named model and the remainder after the > is the binding path.

Visibility: public
valueState sap.ui.core.ValueState None

Visualizes the validation state of the control, e.g. Error, Warning, Success, Information.

Note: This method is public because of an implementation side effect and should not be used for validation purposes as it may conflict with the SmartField control's own binding type validation logic based on the underlying metadata of the bound Entity Data Model (EDM) property. Invoking the .setValueState() and/or .setValueStateText() methods in a change event handle to set an error state does not prevent an invalid value from being stored in the binding/model in two-way data binding scenarios. In addition, it does not fire the validationError event, which is usually required by some upstream modules, for example, the message manager.

Custom validation logic must be implemented in a custom binding type rather than in a change event handler.

Visibility: public
valueStateText string empty string

Defines the text of the value state message popup.

Note: This method is public because of an implementation side effect and should not be used for validation purposes as it may conflict with the SmartField control's own binding type validation logic based on the underlying metadata of the bound Entity Data Model (EDM) property. Invoking the .setValueState() and/or .setValueStateText() methods in a change event handle to set an error state does not prevent an invalid value from being stored in the binding/model in two-way data binding scenarios. In addition, it does not fire the validationError event, which is usually required by some upstream modules, for example, the message manager.

Custom validation logic must be implemented in a custom binding type rather than in a change event handler.

Visibility: public
width sap.ui.core.CSSSize empty string

Defines the width of the control.

Visibility: public
wrapping boolean true

Indicates whether the control break lines (in display mode) to prevent overflow.

Since: 1.36.6.

Visibility: public

Borrowed Aggregations

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

Optional configuration for SmartField.

Note: By default, the value of the displayBehaviour property is not evaluated in edit mode. To enable this feature in edit mode, set the textInEditModeSource control property to a non-default value.

controlProposal 0..1 sap.ui.comp.smartfield.ControlProposal

Proposes a control to be rendered. The SmartField control can ignore the proposal.
Deprecated as of version 1.34.0

semanticObjectController 0..1 sap.ui.comp.navpopover.SemanticObjectController

The Semantic Object Controller allows the user to specify and overwrite functionality for semantic object navigation.


Events Overview

Event Description
beforeCreate

This event is fired before the OData model's create method is called. Provides object with parameters of the call for editing.

Listeners may prevent the default action of this event by calling the preventDefault method on the event object.

beforeRemove

This event is fired before the OData model's remove method is called. Provides object with parameters of the call in key:value format for editing.

Listeners may prevent the default action of this event by calling the preventDefault method on the event object.

selectionChange

This event is fired when item selection is changed. It is relevant only for selection changes on SmartMultiInput elements with fixed values, such as sap.m.MultiComboBox.

selectionFinish

Event is fired when user has finished a selection of items in a list box and list box has been closed. It is relevant only for selection finishes on SmartMultiInput elements with fixed values, such as sap.m.MultiComboBox.

tokenUpdate

This event is fired when the tokens aggregation is changed due to a user action (add / remove token). This event is fired only for token changes in SmartMultiInput elements.

beforeCreate

This event is fired before the OData model's create method is called. Provides object with parameters of the call for editing.

Listeners may prevent the default action of this event by calling the preventDefault method on the event object.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
oData object

Data of the entry that should be created.

mParameters object

Parameter map that will be passed to the OData model's create method, accepts the same properties as mParameters of the create method. Parameters success and error have no meaning as they are changed and used internally.

beforeRemove

This event is fired before the OData model's remove method is called. Provides object with parameters of the call in key:value format for editing.

Listeners may prevent the default action of this event by calling the preventDefault method on the event object.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
mParameters object

Parameter map that will be passed to the OData model's remove method, accepts the same properties as mParameters of the remove method. Parameters success and error have no meaning as they are changed and used internally.

selectionChange

This event is fired when item selection is changed. It is relevant only for selection changes on SmartMultiInput elements with fixed values, such as sap.m.MultiComboBox.

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

Item that was selected or deselected.

selected boolean

Selection state: true if the item is selected, false if item is not selected.

selectionFinish

Event is fired when user has finished a selection of items in a list box and list box has been closed. It is relevant only for selection finishes on SmartMultiInput elements with fixed values, such as sap.m.MultiComboBox.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
selectedItems sap.ui.core.Item[]

The selected items which are selected after list box has been closed.

tokenUpdate

This event is fired when the tokens aggregation is changed due to a user action (add / remove token). This event is fired only for token changes in SmartMultiInput elements.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
type string

Type of TokenUpdate event. There are two TokenUpdate types: added and removed. Use Tokenizer.TokenUpdateType.Added for "added" and Tokenizer.TokenUpdateType.Removed for "removed". See sap.m.Tokenizer for details.

addedTokens sap.m.Token[]

The array of tokens that are added. This parameter is used when tokenUpdate type is "added".

removedTokens sap.m.Token[]

The array of tokens that are removed. This parameter is used when tokenUpdate type is "removed".


Methods Overview

Method Description
attachBeforeCreate

Attaches event handler fnFunction to the beforeCreate event of this sap.ui.comp.smartmultiinput.SmartMultiInput.

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.smartmultiinput.SmartMultiInput itself.

This event is fired before the OData model's create method is called. Provides object with parameters of the call for editing.

attachBeforeRemove

Attaches event handler fnFunction to the beforeRemove event of this sap.ui.comp.smartmultiinput.SmartMultiInput.

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.smartmultiinput.SmartMultiInput itself.

This event is fired before the OData model's remove method is called. Provides object with parameters of the call in key:value format for editing.

attachSelectionChange

Attaches event handler fnFunction to the selectionChange event of this sap.ui.comp.smartmultiinput.SmartMultiInput.

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.smartmultiinput.SmartMultiInput itself.

This event is fired when item selection is changed. It is relevant only for selection changes on SmartMultiInput elements with fixed values, such as sap.m.MultiComboBox.

attachSelectionFinish

Attaches event handler fnFunction to the selectionFinish event of this sap.ui.comp.smartmultiinput.SmartMultiInput.

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.smartmultiinput.SmartMultiInput itself.

Event is fired when user has finished a selection of items in a list box and list box has been closed. It is relevant only for selection finishes on SmartMultiInput elements with fixed values, such as sap.m.MultiComboBox.

attachTokenUpdate

Attaches event handler fnFunction to the tokenUpdate event of this sap.ui.comp.smartmultiinput.SmartMultiInput.

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.smartmultiinput.SmartMultiInput itself.

This event is fired when the tokens aggregation is changed due to a user action (add / remove token). This event is fired only for token changes in SmartMultiInput elements.

checkClientError

Checks whether a client error has been detected. In addition, this method displays an error message, if it is not already displayed.

detachBeforeCreate

Detaches event handler fnFunction from the beforeCreate event of this sap.ui.comp.smartmultiinput.SmartMultiInput.

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

detachBeforeRemove

Detaches event handler fnFunction from the beforeRemove event of this sap.ui.comp.smartmultiinput.SmartMultiInput.

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

detachSelectionChange

Detaches event handler fnFunction from the selectionChange event of this sap.ui.comp.smartmultiinput.SmartMultiInput.

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

detachSelectionFinish

Detaches event handler fnFunction from the selectionFinish event of this sap.ui.comp.smartmultiinput.SmartMultiInput.

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

detachTokenUpdate

Detaches event handler fnFunction from the tokenUpdate event of this sap.ui.comp.smartmultiinput.SmartMultiInput.

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

sap.ui.comp.smartmultiinput.SmartMultiInput.extend

Creates a new subclass of class sap.ui.comp.smartmultiinput.SmartMultiInput 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.comp.smartfield.SmartField.extend.

fireBeforeCreate

Fires event beforeCreate to attached listeners.

Listeners may prevent the default action of this event by calling the preventDefault method on the event object. The return value of this method indicates whether the default action should be executed.

fireBeforeRemove

Fires event beforeRemove to attached listeners.

Listeners may prevent the default action of this event by calling the preventDefault method on the event object. The return value of this method indicates whether the default action should be executed.

fireSelectionChange

Fires event selectionChange to attached listeners.

fireSelectionFinish

Fires event selectionFinish to attached listeners.

fireTokenUpdate

Fires event tokenUpdate to attached listeners.

getEnableODataSelect

Gets current value of property enableODataSelect.

Enables specific properties to be provided in the select query.

Default value is false.

getFilter

Returns a filter that can be applied to restrict the OData query.

sap.ui.comp.smartmultiinput.SmartMultiInput.getMetadata

Returns a metadata object for class sap.ui.comp.smartmultiinput.SmartMultiInput.

getRangeData

Returns an array of token values in range format.

getRequestAtLeastFields

Gets current value of property requestAtLeastFields.

Enables requestAtLeast properties to be added additionally when enableODataSelect is set to True. These are comma-separated value of fields that must be requested from the backend.

Default value is empty string.

getSupportMultiSelect

Gets current value of property supportMultiSelect.

Enables multiple selection in value help dialog.

Default value is true.

getSupportRanges

Gets current value of property supportRanges.

Enables value help with conditions. Can only be used without binding context. Otherwise, has no effect.

Default value is false.

getTokens

Returns tokens selected in SmartMultiInput

getValue

Returns tokens selected in SmartMultiInput

setEnableODataSelect

Sets a new value for property enableODataSelect.

Enables specific properties to be provided in the select query.

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

Default value is false.

setRangeData

Sets tokens based on given objects with range data. Can only be used without a data binding. Otherwise, has no effect.

setRequestAtLeastFields

Sets a new value for property requestAtLeastFields.

Enables requestAtLeast properties to be added additionally when enableODataSelect is set to True. These are comma-separated value of fields that must be requested from the backend.

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

Default value is empty string.

setSupportMultiSelect

Sets a new value for property supportMultiSelect.

Enables multiple selection in value help dialog.

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

Default value is true.

setSupportRanges

Sets a new value for property supportRanges.

Enables value help with conditions. Can only be used without binding context. Otherwise, has no effect.

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

Default value is false.

setTextSeparator

Sets a new value for property textSeparator.

Denotes the separator between texts in the display mode. The default value is loaded from the component resource bundle.

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

attachBeforeCreate

Attaches event handler fnFunction to the beforeCreate event of this sap.ui.comp.smartmultiinput.SmartMultiInput.

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.smartmultiinput.SmartMultiInput itself.

This event is fired before the OData model's create method is called. Provides object with parameters of the call for editing.

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.smartmultiinput.SmartMultiInput itself

attachBeforeRemove

Attaches event handler fnFunction to the beforeRemove event of this sap.ui.comp.smartmultiinput.SmartMultiInput.

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.smartmultiinput.SmartMultiInput itself.

This event is fired before the OData model's remove method is called. Provides object with parameters of the call in key:value format for editing.

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.smartmultiinput.SmartMultiInput itself

attachSelectionChange

Attaches event handler fnFunction to the selectionChange event of this sap.ui.comp.smartmultiinput.SmartMultiInput.

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.smartmultiinput.SmartMultiInput itself.

This event is fired when item selection is changed. It is relevant only for selection changes on SmartMultiInput elements with fixed values, such as sap.m.MultiComboBox.

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.smartmultiinput.SmartMultiInput itself

attachSelectionFinish

Attaches event handler fnFunction to the selectionFinish event of this sap.ui.comp.smartmultiinput.SmartMultiInput.

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.smartmultiinput.SmartMultiInput itself.

Event is fired when user has finished a selection of items in a list box and list box has been closed. It is relevant only for selection finishes on SmartMultiInput elements with fixed values, such as sap.m.MultiComboBox.

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.smartmultiinput.SmartMultiInput itself

attachTokenUpdate

Attaches event handler fnFunction to the tokenUpdate event of this sap.ui.comp.smartmultiinput.SmartMultiInput.

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.smartmultiinput.SmartMultiInput itself.

This event is fired when the tokens aggregation is changed due to a user action (add / remove token). This event is fired only for token changes in SmartMultiInput elements.

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.smartmultiinput.SmartMultiInput itself

checkClientError

Checks whether a client error has been detected. In addition, this method displays an error message, if it is not already displayed.

detachBeforeCreate

Detaches event handler fnFunction from the beforeCreate event of this sap.ui.comp.smartmultiinput.SmartMultiInput.

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

detachBeforeRemove

Detaches event handler fnFunction from the beforeRemove event of this sap.ui.comp.smartmultiinput.SmartMultiInput.

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

detachSelectionChange

Detaches event handler fnFunction from the selectionChange event of this sap.ui.comp.smartmultiinput.SmartMultiInput.

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

detachSelectionFinish

Detaches event handler fnFunction from the selectionFinish event of this sap.ui.comp.smartmultiinput.SmartMultiInput.

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

detachTokenUpdate

Detaches event handler fnFunction from the tokenUpdate event of this sap.ui.comp.smartmultiinput.SmartMultiInput.

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.smartmultiinput.SmartMultiInput.extend

Creates a new subclass of class sap.ui.comp.smartmultiinput.SmartMultiInput 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.comp.smartfield.SmartField.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

fireBeforeCreate

Fires event beforeCreate to attached listeners.

Listeners may prevent the default action of this event by calling the preventDefault method on the event object. The return value of this method indicates whether the default action should be executed.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

oData object

Data of the entry that should be created.

mParameters object

Parameter map that will be passed to the OData model's create method, accepts the same properties as mParameters of the create method. Parameters success and error have no meaning as they are changed and used internally.

fireBeforeRemove

Fires event beforeRemove to attached listeners.

Listeners may prevent the default action of this event by calling the preventDefault method on the event object. The return value of this method indicates whether the default action should be executed.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

mParameters object

Parameter map that will be passed to the OData model's remove method, accepts the same properties as mParameters of the remove method. Parameters success and error have no meaning as they are changed and used internally.

fireSelectionChange

Fires event selectionChange to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

changedItem sap.ui.core.Item

Item that was selected or deselected.

selected boolean

Selection state: true if the item is selected, false if item is not selected.

fireSelectionFinish

Fires event selectionFinish to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

selectedItems sap.ui.core.Item[]

The selected items which are selected after list box has been closed.

fireTokenUpdate

Fires event tokenUpdate to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

type string

Type of TokenUpdate event. There are two TokenUpdate types: added and removed. Use Tokenizer.TokenUpdateType.Added for "added" and Tokenizer.TokenUpdateType.Removed for "removed". See sap.m.Tokenizer for details.

addedTokens sap.m.Token[]

The array of tokens that are added. This parameter is used when tokenUpdate type is "added".

removedTokens sap.m.Token[]

The array of tokens that are removed. This parameter is used when tokenUpdate type is "removed".

getEnableODataSelect

Gets current value of property enableODataSelect.

Enables specific properties to be provided in the select query.

Default value is false.

getFilter

Returns a filter that can be applied to restrict the OData query.

sap.ui.comp.smartmultiinput.SmartMultiInput.getMetadata

Returns a metadata object for class sap.ui.comp.smartmultiinput.SmartMultiInput.

getRangeData

Returns an array of token values in range format.

getRequestAtLeastFields

Gets current value of property requestAtLeastFields.

Enables requestAtLeast properties to be added additionally when enableODataSelect is set to True. These are comma-separated value of fields that must be requested from the backend.

Default value is empty string.

getSupportMultiSelect

Gets current value of property supportMultiSelect.

Enables multiple selection in value help dialog.

Default value is true.

getSupportRanges

Gets current value of property supportRanges.

Enables value help with conditions. Can only be used without binding context. Otherwise, has no effect.

Default value is false.

getTokens

Returns tokens selected in SmartMultiInput

getValue

Returns tokens selected in SmartMultiInput

setEnableODataSelect

Sets a new value for property enableODataSelect.

Enables specific properties to be provided in the select query.

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

New value for property enableODataSelect

setRangeData

Sets tokens based on given objects with range data. Can only be used without a data binding. Otherwise, has no effect.

Param Type DefaultValue Description
vRangeData object array

Object or array of objects with range data. Tokens will be created based on this data and fed into the smart multi input.

setRequestAtLeastFields

Sets a new value for property requestAtLeastFields.

Enables requestAtLeast properties to be added additionally when enableODataSelect is set to True. These are comma-separated value of fields that must be requested from the backend.

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

New value for property requestAtLeastFields

setSupportMultiSelect

Sets a new value for property supportMultiSelect.

Enables multiple selection in value help dialog.

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

New value for property supportMultiSelect

setSupportRanges

Sets a new value for property supportRanges.

Enables value help with conditions. Can only be used without binding context. Otherwise, has no effect.

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

New value for property supportRanges

setTextSeparator

Sets a new value for property textSeparator.

Denotes the separator between texts in the display mode. The default value is loaded from the component resource bundle.

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

Param Type DefaultValue Description
sTextSeparator string

New value for property textSeparator