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:
bParseWithValues
: Whether the #parseValue method requires the current binding values as a third parameter; defaults to false
bUseInternalValues
: Whether the #formatValue and #parseValue methods operate on the internal values; defaults to false
bUseRawValues
: Whether the #formatValue and #parseValue methods operate on the raw model values; the types of embedded bindings are ignored; defaults to false
bUseRawValues
and bUseInternalValues
cannot be both true
.
Method | Description |
---|---|
sap.ui.model.CompositeType.extend |
Creates a new subclass of class sap.ui.model.CompositeType with name
|
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 |
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.
|
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. |
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 |
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 |
Returns a metadata object for class sap.ui.model.CompositeType.
Returns whether the #parseValue method requires the current binding values as a third parameter.
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:
Returns whether the #formatValue and #parseValue methods operate on the internal, related native JavaScript values.
Returns whether the #formatValue and #parseValue methods operate on the raw model values instead of formatted values.
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 |
|
aCurrentValues | array |
The current values of all binding parts; required if #getParseWithValues returns |