abstract class sap.ui.model.CompositeType

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/model/CompositeType
Application Component: CA-UI5-COR

This is an abstract base class for composite types. Composite types have multiple parts and know how to merge/split them upon formatting/parsing the value. Typical use cases are currency or amount values.

Subclasses of CompositeType may set the following boolean properties in the constructor:

bUseRawValues and bUseInternalValues cannot be both true.


Constructor

Constructor for a new CompositeType.

new sap.ui.model.CompositeType(oFormatOptions?, oConstraints?)
Param Type Default Value Description
oFormatOptions? object

Format options as defined by concrete subclasses

oConstraints? object

Constraints as defined by concrete subclasses


Methods Overview

Method Description
sap.ui.model.CompositeType.extend

Creates a new subclass of class sap.ui.model.CompositeType 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.model.SimpleType.extend.

formatValue

Formats the given raw values to an output value of the given target type. This happens according to the format options if the target type is string. If aValues is not defined or null, null is returned.

sap.ui.model.CompositeType.getMetadata

Returns a metadata object for class sap.ui.model.CompositeType.

getParseWithValues

Returns whether the #parseValue method requires the current binding values as a third parameter.

getPartsIgnoringMessages

Gets an array of indices that determine which parts of this type shall not propagate their model messages to the attached control. Prerequisite is that the corresponding binding supports this feature, see sap.ui.model.Binding#supportsIgnoreMessages.

References:

  • sap.ui.model.Binding#supportsIgnoreMessages

getUseInternalValues

Returns whether the #formatValue and #parseValue methods operate on the internal, related native JavaScript values.

getUseRawValues

Returns whether the #formatValue and #parseValue methods operate on the raw model values instead of formatted values.

parseValue

Parses an external value of the given source type to the corresponding values in model representation.

validateValue

Validates whether the given raw values meet the defined constraints. This method does nothing if no constraints are defined.

sap.ui.model.CompositeType.extend

Creates a new subclass of class sap.ui.model.CompositeType 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.model.SimpleType.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

formatValue

Formats the given raw values to an output value of the given target type. This happens according to the format options if the target type is string. If aValues is not defined or null, null is returned.

Param Type DefaultValue Description
aValues any[]

The values to be formatted

sTargetType string

The target type; see Allowed Property Types

sap.ui.model.CompositeType.getMetadata

Returns a metadata object for class sap.ui.model.CompositeType.

getParseWithValues

Returns whether the #parseValue method requires the current binding values as a third parameter.

getPartsIgnoringMessages

Gets an array of indices that determine which parts of this type shall not propagate their model messages to the attached control. Prerequisite is that the corresponding binding supports this feature, see sap.ui.model.Binding#supportsIgnoreMessages.

References:

getUseInternalValues

Returns whether the #formatValue and #parseValue methods operate on the internal, related native JavaScript values.

getUseRawValues

Returns whether the #formatValue and #parseValue methods operate on the raw model values instead of formatted values.

parseValue

Parses an external value of the given source type to the corresponding values in model representation.

Param Type DefaultValue Description
vValue any

The value to be parsed

sSourceType string

The source type (the expected type of vValue); see Allowed Property Types

aCurrentValues array

The current values of all binding parts; required if #getParseWithValues returns true

validateValue

Validates whether the given raw values meet the defined constraints. This method does nothing if no constraints are defined.

Param Type DefaultValue Description
aValues any[]

The set of values to be validated