class sap.ui.unified.ShellHeadUserItem

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/unified/ShellHeadUserItem
Application Component: CA-UI5-CTR

User Header Action Item of the Shell.


Constructor

Constructor for a new ShellHeadUserItem.

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.ui.unified.ShellHeadUserItem(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
image sap.ui.core.URI

An image of the user, normally a URI to an image but also an icon from the sap.ui.core.IconPool is possible.

Visibility: public
showPopupIndicator boolean true

The user item is intended to be used for user settings. Normally these settings are done via a Menu or Dialog. If this property is set to true an indicator for such a popup mechanismn is shown in the item.

Since: 1.27.0.

Visibility: public
username string empty string

The name of the user.

Visibility: public

Associations

Name Cardinality Type Description
ariaLabelledBy 0..n sap.ui.core.Control

Association to controls / ids which label this control (see WAI-ARIA attribute aria-labelledby).


Events Overview

Event Description
press

Event is fired when the user presses the button.

press

Event is fired when the user presses the button.

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

Methods Overview

Method Description
addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

attachPress

Attaches event handler fnFunction to the press event of this sap.ui.unified.ShellHeadUserItem.

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.ui.unified.ShellHeadUserItem itself.

Event is fired when the user presses the button.

detachPress

Detaches event handler fnFunction from the press event of this sap.ui.unified.ShellHeadUserItem.

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

sap.ui.unified.ShellHeadUserItem.extend

Creates a new subclass of class sap.ui.unified.ShellHeadUserItem 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.Element.extend.

firePress

Fires event press to attached listeners.

getAriaLabelledBy

Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.

getImage

Gets current value of property image.

An image of the user, normally a URI to an image but also an icon from the sap.ui.core.IconPool is possible.

sap.ui.unified.ShellHeadUserItem.getMetadata

Returns a metadata object for class sap.ui.unified.ShellHeadUserItem.

getShowPopupIndicator

Gets current value of property showPopupIndicator.

The user item is intended to be used for user settings. Normally these settings are done via a Menu or Dialog. If this property is set to true an indicator for such a popup mechanismn is shown in the item.

Default value is true.

getUsername

Gets current value of property username.

The name of the user.

Default value is empty string.

removeAllAriaLabelledBy

Removes all the controls in the association named ariaLabelledBy.

removeAriaLabelledBy

Removes an ariaLabelledBy from the association named ariaLabelledBy.

setImage

Sets a new value for property image.

An image of the user, normally a URI to an image but also an icon from the sap.ui.core.IconPool is possible.

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

setShowPopupIndicator

Sets a new value for property showPopupIndicator.

The user item is intended to be used for user settings. Normally these settings are done via a Menu or Dialog. If this property is set to true an indicator for such a popup mechanismn is shown in the item.

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

Default value is true.

setUsername

Sets a new value for property username.

The name of the user.

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

Default value is empty string.

addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

Param Type DefaultValue Description
vAriaLabelledBy sap.ui.core.ID sap.ui.core.Control

The ariaLabelledBy to add; if empty, nothing is inserted

attachPress

Attaches event handler fnFunction to the press event of this sap.ui.unified.ShellHeadUserItem.

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.ui.unified.ShellHeadUserItem itself.

Event is fired when the user presses the button.

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.ui.unified.ShellHeadUserItem itself

detachPress

Detaches event handler fnFunction from the press event of this sap.ui.unified.ShellHeadUserItem.

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.ui.unified.ShellHeadUserItem.extend

Creates a new subclass of class sap.ui.unified.ShellHeadUserItem 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.Element.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

getAriaLabelledBy

Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.

getImage

Gets current value of property image.

An image of the user, normally a URI to an image but also an icon from the sap.ui.core.IconPool is possible.

sap.ui.unified.ShellHeadUserItem.getMetadata

Returns a metadata object for class sap.ui.unified.ShellHeadUserItem.

getShowPopupIndicator

Gets current value of property showPopupIndicator.

The user item is intended to be used for user settings. Normally these settings are done via a Menu or Dialog. If this property is set to true an indicator for such a popup mechanismn is shown in the item.

Default value is true.

getUsername

Gets current value of property username.

The name of the user.

Default value is empty string.

removeAllAriaLabelledBy

Removes all the controls in the association named ariaLabelledBy.

removeAriaLabelledBy

Removes an ariaLabelledBy from the association named ariaLabelledBy.

Param Type DefaultValue Description
vAriaLabelledBy int sap.ui.core.ID sap.ui.core.Control

The ariaLabelledBy to be removed or its index or ID

setImage

Sets a new value for property image.

An image of the user, normally a URI to an image but also an icon from the sap.ui.core.IconPool is possible.

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

Param Type DefaultValue Description
sImage sap.ui.core.URI

New value for property image

setShowPopupIndicator

Sets a new value for property showPopupIndicator.

The user item is intended to be used for user settings. Normally these settings are done via a Menu or Dialog. If this property is set to true an indicator for such a popup mechanismn is shown in the item.

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

Default value is true.

Param Type DefaultValue Description
bShowPopupIndicator boolean true

New value for property showPopupIndicator

setUsername

Sets a new value for property username.

The name of the user.

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

Default value is empty string.

Param Type DefaultValue Description
sUsername string ''

New value for property username