Object Card
This type of card can display information about any object in groups. Each group can contain as much items as needed. The Object Card header is coupled with the content, which means that the header cannot make separated requests.
Properties
Property | Type | Default Value | Required | Description | Schema Version | Since |
---|---|---|---|---|---|---|
groups | ObjectGroup[] | Yes | An array of groups. | 1.15.0 | 1.64 | |
actions | Actions[] | No |
Actions that are triggered when the content is pressed.
Note: This property must match completely the property actions on the card header, since only the card header action is assigned as the default card action when using keyboard.
Note: When this property is used to make the full content interactive, the content itself must not contain interactive elements. It is not recommended to nest interactive elements in this scenario. |
1.15.0 | 1.64 | |
hasData | boolean|object|array | true | No | Whether the card has data. If it doesn't, the message for "No data" will be shown. Empty object or empty array mean that the card has no data. | 1.45.0 | 1.105 |
ObjectGroup Properties
Property | Type | Default Value | Required | Description | Schema Version | Since |
---|---|---|---|---|---|---|
title | string | No | The title of the object group. | 1.15.0 | 1.64 | |
items | ObjectGroupItem[] | Yes | Represents items of information. | 1.15.0 | 1.64 | |
visible | boolean | true | No | Determines the visibility of the group. | 1.25.0 | 1.81 |
alignment | string | "Default" | No |
The alignment of the group. Possible values are:
Note: This property is experimental and may change! |
1.38 | 1.98 |
titleMaxLines | number | 1 | No |
Limits the number of lines for wrapping the group title.
Note: This property is experimental and may change! |
1.46 | 1.106 |
labelWrapping | boolean | false | No |
Determines whether the labels of the group items will be wrapped.
Note: This property is experimental and may change! |
1.46 | 1.106 |
ObjectGroupItem Properties
Property | Type | Default Value | Required | Description | Schema Version | Since |
---|---|---|---|---|---|---|
type | string | "Default" | No |
Type of the item. Based on it additional properties of the item are available.
Possible values are:
|
1.15.0 | 1.64 |
icon | Icon | No | Defines the icon of the item. Note: The default value of the icon depends on the icon shape |
1.15.0 | 1.64 | |
label | string | No | Label for the item. When the item has actions it should be set. | 1.15.0 | 1.64 | |
tooltip | string | No | Tooltip for an item that is a link (has defined action). It provides a hint about this action. | 1.45.0 | 1.105 | |
visible | boolean | true | No | Determines the visibility of the item. | 1.25.0 | 1.81 |
showColon | boolean | true | No | Determines if a colon will be shown next to the label. | 1.39.0 | 1.115 |
Additional Properties for ObjectGroupItem of type Default
Property | Type | Required | Description | Schema Version | Since |
---|---|---|---|---|---|
value | string | Yes | Represents the text, which is associated with the label. | 1.15.0 | 1.64 |
actions | Actions[] | No | Actions that are triggered when the item is pressed. | 1.31.0 | 1.87 |
maxLines | int | No |
Limits the number of lines for wrapping texts.
Note: This property is experimental and may change! Note: This property cannot be used together with actions .
|
1.38 | 1.98 |
Additional Properties for ObjectGroupItem of type NumericData
Property | Type | Default Value | Required | Description | Schema Version | Since |
---|---|---|---|---|---|---|
mainIndicator | MainIndicator | Yes | Numeric indicator. | 1.38 | 1.98 | |
sideIndicators | SideIndicator[] | No | Side indicators that relate to the main numeric indicator. You can have a maximum of two side indicators. | 1.38 | 1.98 | |
sideIndicatorsAlignment | sap.f.cards.NumericHeaderSideIndicatorsAlignment | "Begin" | No | The alignment of the side indicators in the numeric header. | 1.38 | 1.98 |
details | string | No | Additional information about the numeric data. The text overflows with ellipsis after the first line. | 1.38 | 1.98 |
Additional Properties for ObjectGroupItem of type Status
Property | Type | Required | Description | Schema Version | Since |
---|---|---|---|---|---|
value | string | Yes | The status. | 1.38 | 1.98 |
state | sap.ui.core.ValueState | No | The semantic state of the status. | 1.38 | 1.98 |
showStateIcon | boolean | No | Defines if a state icon is shown. | 1.50.0 | 1.110 |
customStateIcon | string | No | The custom state icon. If it is set, then showStateIcon property should be set to true. |
1.53.0 | 1.113 |
inverted | boolean | No | If set to true, the background color of the item is inverted. | 1.73.0 | 1.136 |
Additional Properties for ObjectGroupItem of type IconGroup
Property | Type | Required | Description | Schema Version | Since |
---|---|---|---|---|---|
path | string | Yes | The binding path. | 1.41 | 1.100 |
template | IconGroupTemplate | Yes | The template from which all the icons in the group will be created. | 1.41 | 1.100 |
size | string | No |
One of "XS", "S" or "M". By default it is set to "XS". Note: This property is experimental and may change! |
1.40 | 1.100 |
IconGroupTemplate
Property | Type | Required | Description | Schema Version | Since |
---|---|---|---|---|---|
icon | IconGroupIcon | Yes | Defines the properties of the icons. | 1.41 | 1.100 |
actions | Actions[] | No | Actions that are triggered when the icon is pressed. | 1.41 | 1.100 |
IconGroupIcon
Property | Type | Required | Description | Schema Version | Since |
---|---|---|---|---|---|
src | string | Yes | Icon name or source URL | 1.41 | 1.100 |
initials | string | No | Used as fallback if the "src" property is not set or there is an issue with the resource. Up to two Latin letters can be displayed. If there are more than two letters, or if there's a non-Latin character present, a default image placeholder will be created. | 1.47.0 | 1.107 |
alt | string | No | Alternative text for the icon. Also shown as a tooltip. Enables you to provide meaningful alternative texts to support screen-reader users. | 1.41 | 1.100 |
Icon Properties
Property | Type | Required | Description | Schema Version | Since |
---|---|---|---|---|---|
src | string | No | Icon name or source URL | 1.15.0 | 1.65 |
shape | sap.m.AvatarShape | No | The shape of the icon. | 1.26.0 | 1.82 |
alt | string | No | Alternative text for the icon. If not provided, a default value is set, which might be confusing for screen reader users, when there are more than one card in the view. | 1.26.0 | 1.82 |
size | string | No |
One of "XS", "S" or "M". By default it is set to "XS". Note: This property is experimental and may change! |
1.26.0 | 1.82 |
backgroundColor | sap.m.AvatarColor | No |
By default it is set to "Transparent". Note: This property is experimental and may change! |
1.27.0 | 1.83 |
initials | string | No | Used as fallback if the "src" property is not set or there is an issue with the resource. Up to two Latin letters can be displayed. If there are more than two letters, or if there's a non-Latin character present, a default image placeholder will be created. | 1.47.0 | 1.107 |
visible | boolean | No | Defines whether the icon should be displayed. | 1.48.0 | 1.108 |
fitType | sap.m.AvatarImageFitType | No | Used to determine how the image will fit in the icon space. | 1.67.0 | 1.130 |
MainIndicator Properties
Property | Type | Default Value | Required | Description | Schema Version | Since |
---|---|---|---|---|---|---|
number | string | Yes | The value of the main indicator. | 1.38 | 1.98 | |
unit | string | No | The unit of measurement of the main indicator. | 1.38 | 1.98 | |
trend | sap.m.DeviationIndicator | "None" | No | The trend indicator (direction). | 1.38 | 1.98 |
state | sap.m.ValueColor | "Neutral" | No | The semantic state color of the main indicator. | 1.38 | 1.98 |
size | string | "L" | No | The size of the main indicator. Possible values are "S" and "L". | 1.38 | 1.98 |
Additional Properties for ObjectGroupItem of type ComboBox (experimental since 1.104)
Check samples on how to submit a form with extension or with action handlers.
Property | Type | Required | Description | Schema Version | Since |
---|---|---|---|---|---|
id | string | Yes | Defines the id of the form input. Will be used in the submitted payload. | 1.44 | 1.104 |
value | string | No |
Defines the initial free text value for the input.
For defining an initially selected option use "selectedKey". |
1.44 | 1.104 |
selectedKey | string | No |
Defines the initially selected key from the given options.
If there is no option with that key, nothing will be selected. This property overrides the "value" property. |
1.44 | 1.104 |
placeholder | string | No | Defines a short hint intended to aid the user with data entry when the control has no value. | 1.44 | 1.104 |
item | ComboBoxItemBindingInfo | No | Binding info object used to bind data to options of the ComboBox. | 1.44 | 1.104 |
validations | ObjectGroupItemValidation[] | No | Defines the user input validations. | 1.44 | 1.106 |
ComboBoxItemBindingInfo Properties
Property | Type | Default Value | Required | Description | Schema Version | Since | |
---|---|---|---|---|---|---|---|
path | string | / | No | The context path. | 1.44 | 1.104 | |
template | Yes | Binding template for items | |||||
title | string | Yes | The title of the item which appears in the dropdown. | 1.44 | 1.104 | ||
key | string | Yes | The key of the item. This key corresponds to the value of the ComboBox. | 1.44 | 1.104 |
Additional Properties for ObjectGroupItem of type TextArea (experimental since 1.104)
Property | Type | Required | Description | Schema Version | Since |
---|---|---|---|---|---|
id | string | Yes | Defines the id of the form input. Will be used in the submitted payload. | 1.44 | 1.104 |
value | string | No | Defines the initial value for the TextArea. | 1.44 | 1.104 |
placeholder | string | No | Defines a short hint intended to aid the user with data entry when the control has no value. | 1.44 | 1.104 |
rows | integer | No | Number of visible text lines. | 1.44 | 1.104 |
validations | ObjectGroupItemValidation[] | No | Defines the user input validations. | 1.44 | 1.106 |
Additional Properties for ObjectGroupItem of type Input (experimental since 1.112)
Property | Type | Required | Description | Schema Version | Since |
---|---|---|---|---|---|
id | string | Yes | Defines the ID of the form input. Will be used in the submitted payload. | 1.52 | 1.112 |
value | string | No | Defines the initial value for the input. | 1.52 | 1.112 |
placeholder | string | No | Defines a short hint intended to aid the user with data entry when there is no value set. | 1.52 | 1.112 |
validations | ObjectGroupItemValidation[] | No | Defines the user input validations. | 1.52 | 1.112 |
Additional Properties for ObjectGroupItem of type Duration (experimental since 1.114)
Property | Type | Required | Description | Schema Version | Since |
---|---|---|---|---|---|
id | string | Yes | Defines the ID of the form duration input. Will be used in the submitted payload. | 1.54 | 1.114 |
value | string | No |
Defines the initial value for the duration input. It should be in ISO 8601 duration format.
For example "PT10H30M" is 10 hours and 30 minutes.
The following restrictions apply:
|
1.54 | 1.114 |
placeholder | string | No | Defines a short hint intended to aid the user with data entry when there is no value set. | 1.54 | 1.114 |
validations | ObjectGroupItemValidation[] | No | Defines the user duration-input validations. | 1.54 | 1.114 |
Additional Properties for ObjectGroupItem of type RatingIndicator (experimental since 1.111)
Property | Type | Default Value | Required | Description | Schema Version | Since |
---|---|---|---|---|---|---|
maxValue | number | 5 | No | The number of displayed rating symbols. | 1.51 | 1.111 |
value | number | 0 | No | The indicated value of the rating. | 1.51 | 1.111 |
visualMode | sap.m.RatingIndicatorVisualMode | "Half" | No | Defines how float values are visualized: Full (values are rounded to the nearest integer value (e.g. 1.7 -> 2)) or Half (values are rounded to the nearest half-increment value (e.g. 1.7 -> 1.5)) | 1.51 | 1.111 |
Additional Properties for ObjectGroupItem of type Image (experimental since 1.112)
Property | Type | Default Value | Required | Description | Schema Version | Since |
---|---|---|---|---|---|---|
src | string | Yes | Image source URL. | 1.52 | 1.112 | |
fallbackSrc | string | No | Fallback image source URL that will be loaded in case src fails to load. |
1.67 | 1.128 | |
аlt | string | Yes | Provides alternative text that is used in case the image is not available, or cannot be displayed. | 1.52 | 1.112 | |
fullWidth | boolean | false | No | Defines if the image will take the full width of the group, including the paddings. If set to false there will be a padding. For best result use together with "alignment": "Stretched" for the group. | 1.52 | 1.112 |
height | string | "" | No | The height of the image. | 1.61 | 1.121 |
imageFit | string | "" | No | This property is for adjusting the image size using the CSS style background-size . |
1.61 | 1.121 |
imagePosition | string | "" | No | This property is for adjusting the image position using the CSS style background-position . |
1.61 | 1.121 |
overlay | Overlay | No | Defines if the image will have overlay with texts (experimental since 1.121) | 1.61 | 1.121 |
Properties of Overlay property (experimental since 1.121)
Property | Type | Default Value | Required | Description | Schema Version | Since |
---|---|---|---|---|---|---|
supertitle | string | "" | No | The text that will be displayed before the title. | 1.61 | 1.121 |
title | string | "" | No | The title. | 1.61 | 1.121 |
subTitle | string | "" | No | The text that will be displayed after the title. | 1.61 | 1.121 |
verticalPosition | string | "Start" | No | The vertical position of the texts. Possible values are: "Start", "End", "Center" | 1.61 | 1.121 |
horizontalPosition | string | "Start" | No | The horizontal position of the texts. Possible values are: "Start", "End", "Center" | 1.61 | 1.121 |
padding | string | "" | No |
Set to "MediumStart" to have medium size padding in the beginning of the texts.
Note: Only available option is "MediumStart". Note: Use only with "horizontalPosition" property set to "Start". If the "horizontalPosition" is "Center" and the "padding" is "MediumStart", the texts will not be centered, because of the added padding. |
1.62 | 1.122 |
textColor | string | "" | No | The color of the texts.
Note: If set, the text color would not be themeable (will stay the same as provided with this property and won't change with the theme). Note: The card developer is responsible for the contrast ratio - right text color and overlay background effect should be set. |
1.61 | 1.121 |
textFilter | string | "" | No | The CSS filter which will be applied to the text.
Note: If set, the colors in the filter would not be themeable (will stay the same as provided with this property and won't change with the theme). Note: The card developer is responsible for the contrast ratio in combination between text color, filter and image. |
1.62 | 1.122 |
background | string | "" | No | The color of the background, which is placed under the texts and over the image.
Note: If set, the text background color would not be themeable (will stay the same as provided with this property and won't change with the theme). Note: The card developer is responsible for the contrast ratio - right text color and overlay background effect should be set. |
1.61 | 1.121 |
animation | string | "None" | No | Defines the animation that should be used to show up the overlay. Possible values are: "FadeIn" and "None".
Note: This property will take effect only if the global UI5 parameter "animationMode" is set to "full". Which is the default. | 1.62 | 1.122 |
Additional Properties for ObjectGroupItem of type DateRange (experimental since 1.115)
Property | Type | Required | Description | Schema Version | Since |
---|---|---|---|---|---|
id | string | Yes | Defines the ID of the form date range input. Will be used in the submitted payload. | 1.55 | 1.115 |
value | DateRangeValue | No | Defines the initial value for the date range input. | 1.55 | 1.115 |
placeholder | string | No | Defines a short hint intended to aid the user with data entry when the control has no value. | 1.73 | 1.136 |
validations | ObjectGroupItemValidation[] | No | Defines the user input validations. | 1.55 | 1.115 |
DateRangeValue Properties
Property | Type | Default Value | Required | Description | Schema Version | Since |
---|---|---|---|---|---|---|
option | string | Yes | The date range option. For now only "date" option is available. | 1.55 | 1.115 | |
values | array | Yes | Values to initialize the option. For the "date" option an array with a single element should be provided. It can be every valid JavaScript Date format like timestamp or date string. | 1.55 | 1.155 |
The following values are available in the "form" model for item of type "DateRange":
Path | Description |
---|---|
{form>/idOfTheItem/value/option} | The current option. |
{form>/idOfTheItem/value/values} | The current option values. |
{form>/idOfTheItem/range/start} | The start date of the range in ISO 8601 format in UTC time zone. |
{form>/idOfTheItem/range/end} | The end date of the range in ISO 8601 format in UTC time zone. |
{form>/idOfTheItem/range/startLocalDate} | The start date of the range in short ISO 8601 date format in the local time zone. Use this property if you want to select a single date without reference to the time of the day. |
{form>/idOfTheItem/range/endLocalDate} | The end date of the range in short ISO 8601 date format in the local time zone. |
{form>/idOfTheItem/rangeOData/start} | The start date of the range in ISO 8601 format in UTC time zone. It is in the boundaries of Edm.DateTime type of the OData protocol. |
{form>/idOfTheItem/rangeOData/end} | The end date of the range in ISO 8601 format in UTC time zone. It is in the boundaries of Edm.DateTime type of the OData protocol. |
{form>/idOfTheItem/range/startLocalDate} | The start date of the range in short ISO 8601 date format in the local time zone. It is in the boundaries of Edm.DateTime type of the OData protocol. |
{form>/idOfTheItem/range/endLocalDate} | The end date of the range in short ISO 8601 date format in the local time zone. It is in the boundaries of Edm.DateTime type of the OData protocol. |
ObjectGroupItemValidation Properties
Property | Type | Default Value | Required | Description | Schema Version | Since |
---|---|---|---|---|---|---|
message | string | No | Defines custom validation message text. | 1.44 | 1.106 | |
type | string | "Error" | No | Defines the validation type - "Error", "Warning" or "Information". | 1.44 | 1.106 |
required | boolean | false | No | Defines whether the user input is required. | 1.44 | 1.106 |
minLength | integer | No | Defines the minimum number of characters. | 1.44 | 1.106 | |
maxLength | integer | No | Defines the maximum number of characters. | 1.44 | 1.106 | |
restrictToPredefinedOptions | boolean | false | No | Defines whether the value is restricted to predefined options. | 1.44 | 1.106 |
pattern | string | No |
Defines the regular expression pattern that should match the value.
Note: The regular expression must be properly escaped in JSON format. E.g. a single backslash "\" should be escaped and therefore represented as double backslashes "\\". Note: The "pattern" property cannot be used with binding. |
1.47 | 1.108 | |
validate | string | No | The name of an extension function used to validate the value | 1.47 | 1.108 |
Example
Define the type and data for the card:
{ "sap.card": { "type": "Object", "data": { "request": { "url": "./employee.json" } } } }
The content of the employee.json which we are requesting:
{ "firstName": "Donna", "lastName": "Moore", "position": "Sales Executive", "phone": "+1 202 555 5555", "tooltip": "Make a call", "photo": "../images/Woman_avatar_01.png", "manager": { "firstName": "John", "lastName": "Miller", "photo": "../images/Woman_avatar_02.png" }, "company": { "name": "Company A", "address": "481 West Street, Anytown OH 45066, USA", "website": "www.company_a.example.com" } }
Define the header:
"header": { "icon": { "src": "{photo}" }, "title": "{firstName} {lastName}", "subTitle": "{position}" },
Define the content in groups:
"content": { "groups": [ { "title": "Contact Details", "items": [ { "label": "First Name", "value": "{firstName}" }, { "label": "Last Name", "value": "{lastName}" }, { "label": "Phone", "value": "{phone}", "tooltip": "{tooltip}", "actions": [ { "type": "Navigation", "parameters": { "url": "tel:{phone}" } } ] }, { "label": "Email", "value": "{email}", "actions": [ { "type": "Navigation", "parameters": { "url": "mailto:{email}" } } ] } ] }, { "title": "Company Details", "items": [ { "label": "Company Name", "value": "{company/name}" }, { "label": "Address", "value": "{company/address}" }, { "label": "Email", "value": "{company/email}", "actions": [ { "type": "Navigation", "parameters": { "url": "mailto:{company/email}?subject={company/emailSubject}" } } ] }, { "label": "Website", "value": "{company/website}", "actions": [ { "type": "Navigation", "parameters": { "url": "{company/url}", } } ] } ] }, { "title": "Organizational Details", "items": [ { "label": "Direct Manager", "value": "{manager/firstName} {manager/lastName}", "icon": { "src": "{manager/photo}", "visible": true } } ] } ] }
Here is the final manifest definition:
{ "sap.app": { "id": "card.explorer.object.card", "type": "card", "i18n": "i18n/i18n.properties", "applicationVersion": { "version": "1.0.0" } }, "sap.card": { "type": "Object", "data": { "request": { "url": "./cardcontent/objectcontent/employee.json" } }, "header": { "icon": { "src": "{photo}" }, "title": "{firstName} {lastName}", "subTitle": "{position}" }, "content": { "groups": [ { "title": "{{contactDetails}}", "items": [ { "label": "{{firstName}}", "value": "{firstName}" }, { "label": "{{lastName}}", "value": "{lastName}" }, { "label": "{{phone}}", "value": "{phone}", "actions": [ { "type": "Navigation", "parameters": { "url": "tel:{phone}" } } ] }, { "label": "{{email}}", "value": "{email}", "actions": [ { "type": "Navigation", "parameters": { "url": "mailto:{email}" } } ] } ] }, { "title": "{{organizationalDetails}}", "items": [ { "label": "{{directManager}}", "value": "{manager/firstName} {manager/lastName}", "icon": { "src": "{manager/photo}" } } ] }, { "title": "{{companyDetails}}", "items": [ { "label": "{{companyName}}", "value": "{company/name}" }, { "label": "{{address}}", "value": "{company/address}" }, { "label": "{{email}}", "value": "{company/email}", "actions": [ { "type": "Navigation", "parameters": { "url": "mailto:{company/email}?subject={company/emailSubject}" } } ] }, { "label": "{{website}}", "value": "{company/website}", "actions": [ { "type": "Navigation", "parameters": { "url": "{company/url}" } } ] } ] } ] } } }
Create the view to display the card:
<mvc:View xmlns:w="sap.ui.integration.widgets"> <w:Card manifest="./manifest.json" width="400px" height="auto" /> </mvc:View>Try it Out
Validate Input Fields
The user input provided in the form fields can be validated. More info here.