class sap.f.Card

Control sample: sap.f.Card
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Extends: sap.f.CardBase
Module: sap/f/Card
Application Component: CA-UI5-CTR

A control that represents a container with a predefined header and content.

Overview

The card is a container for grouping and displaying information.

Structure

You can control the width and height of the card, using properties. The Card has the following aggregations:

Guidelines:

Usage

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

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


Properties

Name Type Default Value Description
headerPosition sap.f.cards.HeaderPosition Top

Defines the position of the Card Header.

Since: 1.65.

Visibility: public

Borrowed Properties

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

Aggregations

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.


Methods Overview

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 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.

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 Top.

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 null or undefined, the default value of the property will be restored.

Default value is Top.

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 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

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 Top.

sap.f.Card.getMetadata

Returns a metadata object for class sap.f.Card.

setContent

Sets the aggregated content.

Param Type DefaultValue Description
oContent sap.ui.core.Control

The content to set

setHeader

Sets the aggregated header.

Param Type DefaultValue Description
oHeader sap.f.cards.IHeader

The header to set

setHeaderPosition

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 headerPosition