class sap.f.AvatarGroup

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

Displays a group of avatars arranged horizontally. It is useful to visually showcase a group of related avatars, such as, project team members or employees.

Overview

The control allows you to display the avatars in different sizes, depending on your use case.

The AvatarGroup control has two group types:

Responsive Behavior

When the available space is less than the width required to display all avatars, an overflow visualization appears as a button placed at the end with the same shape and size as the avatars. The visualization displays the number of avatars that have overflowed and are not currently visible.

Usage

Use the AvatarGroup if:

Do not use the AvatarGroup if:


Constructor

Constructor for a new AvatarGroup.

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.AvatarGroup(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
avatarDisplaySize sap.m.AvatarSize S

Defines the display size of each avatar.

Visibility: public
groupType sap.f.AvatarGroupType Group

Defines the mode of the AvatarGroup.

Visibility: public

Aggregations

Default Aggregation: items

Name Cardinality Type Description
items (default) 0..n sap.f.AvatarGroupItem

The AvatarGroupItems contained by the control.


Events Overview

Event Description
press

Fired when the user clicks or taps on the control.

press

Fired when the user clicks or taps on the control.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
groupType string

The GroupType of the control.

overflowButtonPressed boolean

Indication whether the overflow button is pressed.

avatarsDisplayed int

The number of currently displayed (visible) avatars.


Methods Overview

Method Description
addItem

Adds some item to the aggregation items.

attachPress

Attaches event handler fnFunction to the press event of this sap.f.AvatarGroup.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.f.AvatarGroup itself.

Fired when the user clicks or taps on the control.

destroyItems

Destroys all the items in the aggregation items.

detachPress

Detaches event handler fnFunction from the press event of this sap.f.AvatarGroup.

The passed function and listener object must match the ones used for event registration.

sap.f.AvatarGroup.extend

Creates a new subclass of class sap.f.AvatarGroup 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.core.Control.extend.

firePress

Fires event press to attached listeners.

getAvatarDisplaySize

Gets current value of property avatarDisplaySize.

Defines the display size of each avatar.

Default value is S.

getGroupType

Gets current value of property groupType.

Defines the mode of the AvatarGroup.

Default value is Group.

getItems

Gets content of aggregation items.

The AvatarGroupItems contained by the control.

sap.f.AvatarGroup.getMetadata

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

indexOfItem

Checks for the provided sap.f.AvatarGroupItem in the aggregation items. and returns its index if found or -1 otherwise.

insertItem

Inserts a item into the aggregation items.

removeAllItems

Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

removeItem

Removes a item from the aggregation items.

setAvatarDisplaySize

Sets a new value for property avatarDisplaySize.

Defines the display size of each avatar.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is S.

setGroupType

Sets a new value for property groupType.

Defines the mode of the AvatarGroup.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is Group.

addItem

Adds some item to the aggregation items.

Param Type DefaultValue Description
oItem sap.f.AvatarGroupItem

The item to add; if empty, nothing is inserted

attachPress

Attaches event handler fnFunction to the press event of this sap.f.AvatarGroup.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.f.AvatarGroup itself.

Fired when the user clicks or taps on the control.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.f.AvatarGroup itself

destroyItems

Destroys all the items in the aggregation items.

detachPress

Detaches event handler fnFunction from the press event of this sap.f.AvatarGroup.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

sap.f.AvatarGroup.extend

Creates a new subclass of class sap.f.AvatarGroup 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.core.Control.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

firePress

Fires event press to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

groupType string

The GroupType of the control.

overflowButtonPressed boolean

Indication whether the overflow button is pressed.

avatarsDisplayed int

The number of currently displayed (visible) avatars.

getAvatarDisplaySize

Gets current value of property avatarDisplaySize.

Defines the display size of each avatar.

Default value is S.

getGroupType

Gets current value of property groupType.

Defines the mode of the AvatarGroup.

Default value is Group.

getItems

Gets content of aggregation items.

The AvatarGroupItems contained by the control.

sap.f.AvatarGroup.getMetadata

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

indexOfItem

Checks for the provided sap.f.AvatarGroupItem in the aggregation items. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oItem sap.f.AvatarGroupItem

The item whose index is looked for

insertItem

Inserts a item into the aggregation items.

Param Type DefaultValue Description
oItem sap.f.AvatarGroupItem

The item to insert; if empty, nothing is inserted

iIndex int

The 0-based index the item should be inserted at; for a negative value of iIndex, the item is inserted at position 0; for a value greater than the current size of the aggregation, the item is inserted at the last position

removeAllItems

Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

removeItem

Removes a item from the aggregation items.

Param Type DefaultValue Description
vItem int string sap.f.AvatarGroupItem

The item to remove or its index or id

setAvatarDisplaySize

Sets a new value for property avatarDisplaySize.

Defines the display size of each avatar.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is S.

Param Type DefaultValue Description
sAvatarDisplaySize sap.m.AvatarSize S

New value for property avatarDisplaySize

setGroupType

Sets a new value for property groupType.

Defines the mode of the AvatarGroup.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is Group.

Param Type DefaultValue Description
sGroupType sap.f.AvatarGroupType Group

New value for property groupType