SAPUI5 supports simple types that are used together with OData models.
These types support OData Version 2.0 and/or Version 4.0 including relevant property facets as constraints. See the type’s documentation for detailed information about which OData versions, constraints and format options are supported.
OData Type |
SAPUI5 Type Implementation |
---|---|
Edm.Boolean |
sap.ui.model.odata.type.Boolean For more information, see sap.ui.model.odata.type.Boolean in the API Reference. |
Edm.Byte |
sap.ui.model.odata.type.Byte For more information, see sap.ui.model.odata.type.Byte in the API Reference. |
Edm.Date |
sap.ui.model.odata.type.Date For more information, see sap.ui.model.odata.type.Date in the API Reference. |
Edm.DateTime |
sap.ui.model.odata.type.DateTime For more information, see sap.ui.model.odata.type.DateTime in the API Reference. |
Edm.DateTimeOffset |
sap.ui.model.odata.type.DateTimeOffset For more information, see sap.ui.model.odata.type.DateTimeOffset in the API Reference. |
Edm.Decimal |
sap.ui.model.odata.type.Decimal For more information, see sap.ui.model.odata.type.Decimal in the API Reference. |
Edm.Double |
sap.ui.model.odata.type.Double For more information, see sap.ui.model.odata.type.Double in the API Reference. |
Edm.Guid |
sap.ui.model.odata.type.Guid For more information, see sap.ui.model.odata.type.Guid in the API Reference. |
Edm.Int16 |
sap.ui.model.odata.type.Int16 For more information, see sap.ui.model.odata.type.Int16 in the API Reference. |
Edm.Int32 |
sap.ui.model.odata.type.Int32 For more information, see sap.ui.model.odata.type.Int32 in the API Reference. |
Edm.Int64 |
sap.ui.model.odata.type.Int64 For more information, see sap.ui.model.odata.type.Int64 in the API Reference. |
Edm.SByte |
sap.ui.model.odata.type.SByte For more information, see sap.ui.model.odata.type.SByte in the API Reference. |
Edm.Single |
sap.ui.model.odata.type.Single For more information, see sap.ui.model.odata.type.Single in the API Reference. |
Edm.String |
sap.ui.model.odata.type.String For more information, see sap.ui.model.odata.type.String in the API Reference. |
Edm.Time |
sap.ui.model.odata.type.Time For more information, see sap.ui.model.odata.type.Time in the API Reference. |
Edm.TimeOfDay |
sap.ui.model.odata.type.TimeOfDay For more information, see sap.ui.model.odata.type.TimeOfDay in the API Reference. |
With XML templating, the data types are used by the sap.ui.model.odata.AnnotationHelper with the constraints defined in the OData metadata.
The following code snippet shows an excerpt from an XML template view:
<Label text="{path: 'Label', formatter: 'sap.ui.model.odata.AnnotationHelper.format'}"/> <Input value="{path: 'Value', formatter: 'sap.ui.model.odata.AnnotationHelper.format'}"/>
However, you can use these types independently in data bindings.
The following code snippet shows an excerpt from an XML view without XML templating:
<Label text="Birthday"/> <Input value="{path: 'Birthday', type: 'sap.ui.model.odata.type.DateTime', constraints: {displayFormat: 'Date', nullable: false}}"/>