A control that represents a container with a predefined header and content.
The card is a container for grouping and displaying information.
You can control the width and height of the card, using properties. The Card
has the following aggregations:
header
- can be either a Header or a NumericHeader content
- can be any Control.
To show a KPI value or any numeric information, use NumericHeader as a card header. For any other use cases, use the regular Header. Recommended content: - List - Table - Object information - Charts - Timelines - Images
When to use
When not to use
Constructor for a new Card
.
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.f.Card(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 |
Name | Type | Default Value | Description |
---|---|---|---|
headerPosition | sap.f.cards.HeaderPosition | Top | Defines the position of the Card Header. |
Name | Type | Default Value | Description |
---|---|---|---|
height | sap.ui.core.CSSSize | auto | Defines the height of the card. Visibility: public |
width | sap.ui.core.CSSSize | 100% | Defines the width of the card. Visibility: public |
Default Aggregation:
Name | Cardinality | Type | Description |
---|---|---|---|
content | 0..1 | sap.ui.core.Control |
Defines the content of the card. |
header | 0..1 | sap.f.cards.IHeader |
Defines the header of the card. |
Method | Description |
---|---|
destroyContent |
Destroys the content in the aggregation content. |
destroyHeader |
Destroys the header in the aggregation header. |
sap.f.Card.extend |
Creates a new subclass of class sap.f.Card with name
|
getCardContent |
Implements sap.f.ICard interface. |
getCardHeader |
Implements sap.f.ICard interface. |
getCardHeaderPosition |
Implements sap.f.ICard interface. |
getContent |
Gets content of aggregation content. Defines the content of the card. |
getHeader |
Gets content of aggregation header. Defines the header of the card. |
getHeaderPosition |
Gets current value of property headerPosition. Defines the position of the Card Header. Default value is |
sap.f.Card.getMetadata |
Returns a metadata object for class sap.f.Card. |
setContent |
Sets the aggregated content. |
setHeader |
Sets the aggregated header. |
setHeaderPosition |
Sets a new value for property headerPosition. Defines the position of the Card Header. When called with a value of Default value is |
Creates a new subclass of class sap.f.Card with name sClassName
and enriches it with the information contained in oClassInfo
.
oClassInfo
might contain the same kind of information as described in sap.f.CardBase.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 |
Gets current value of property headerPosition.
Defines the position of the Card Header.
Default value is Top
.
Sets the aggregated content.
Param | Type | DefaultValue | Description |
---|---|---|---|
oContent | sap.ui.core.Control |
The content to set |
Sets the aggregated header.
Param | Type | DefaultValue | Description |
---|---|---|---|
oHeader | sap.f.cards.IHeader |
The header to set |
Sets a new value for property headerPosition.
Defines the position of the Card Header.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Top
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sHeaderPosition | sap.f.cards.HeaderPosition | Top |
New value for property |