class sap.ui.ux3.ActionBar

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

A special toolbar with predefined social actions which can be shown as needed. These are: Create an update (Feed), Follow, Mark for Follow Up, Mark as Favorite and Open Thing.

In addition business actions (ThingAction instances) can be added which are either displayed as MenuItems of the 'More' menu button or as individual tool bar buttons.

When using this control, please be aware that it fulfills rather specific requirements: it has been designed for and is used within composite controls QuickView and ThingInspector.


Constructor

Constructor for a new ActionBar.

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.ux3.ActionBar(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
alwaysShowMoreMenu boolean true

If true, business actions are rendered as menu items of the 'More' menu button. Otherwise, 'More' menu button is only displayed for overflow and business actions are rendered as inidividual buttons.

Visibility: public
dividerWidth sap.ui.core.CSSSize

The minimum width of ActionBar's the social actions part: business action controls have to be rendered outside this area

Visibility: public
favoriteState boolean

Indicates whether “Favorite” is active

Visibility: public
flagState boolean

Indicates whether “Mark for Follow Up” is active

Visibility: public
followState sap.ui.ux3.FollowActionState Default

Keeps track of the actionBars Follow/Unfollow button’s state. Its value is one of - FollowActionState.Default - FollowActionState.Follow - FollowActionState.Hold

Visibility: public
showFavorite boolean true

Indicates whether social action “Favorite” is shown, default is ‘true’

Visibility: public
showFlag boolean true

Indicates whether social action “Mark for Follow Up” is shown, default is ‘true’

Visibility: public
showFollow boolean true

Indicates whether social action “Follow” is shown, default is ‘true’

Visibility: public
showOpen boolean true

Indicates whether social action “Open” is shown, default is ‘true’

Visibility: public
showUpdate boolean true

Indicates whether social action “Update” is shown, default is ‘true’

Visibility: public
thingIconURI sap.ui.core.URI

The thing icon uri. Icon will be displayed in Feeder

Visibility: public
updateState boolean

Indicates whether “Update” is active

Visibility: public

Aggregations

Default Aggregation:

Name Cardinality Type Description
_businessActionButtons 0..n sap.ui.commons.Button

Buttons for the business actions - managed by this ActionBar

_socialActions 0..n sap.ui.ux3.ThingAction

The social actions which are managed by this ActionBar

businessActions 0..n sap.ui.ux3.ThingAction

Displayed on the actionBar's right hand-side, either as menu item under 'More' or as individual buttons


Events Overview

Event Description
actionSelected

Fired when any of the social action’s toolbar buttons except ‘Update’ or any of the business action’s menu items resp. buttons is pressed. The selected action can be identified by its id and newState (the latter if applicable only) ‘Follow’ button + menu: id: follow, newState: Follow/Hold/Default ‘Mark for follow up’ button: id: flag, newState: true/false ‘Favorite’ button: id: favorite, newState: true/false ‘Open Thing Inspector’ button id: open Business Actions: id: the ThingAction id

For ‘Update’, please refer to event ‘feedSubmit’

feedSubmit

Fired when a new feed entry is submitted.

actionSelected

Fired when any of the social action’s toolbar buttons except ‘Update’ or any of the business action’s menu items resp. buttons is pressed. The selected action can be identified by its id and newState (the latter if applicable only) ‘Follow’ button + menu: id: follow, newState: Follow/Hold/Default ‘Mark for follow up’ button: id: flag, newState: true/false ‘Favorite’ button: id: favorite, newState: true/false ‘Open Thing Inspector’ button id: open Business Actions: id: the ThingAction id

For ‘Update’, please refer to event ‘feedSubmit’

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

Id of selected ThingAction

action sap.ui.ux3.ThingAction

Selected ThingAction

newState string

New State of the selected action.Only filled if the respective action maintains a state property, for example 'FollowUp' or 'Favorite'

feedSubmit

Fired when a new feed entry is submitted.

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

Feed text


Methods Overview

Method Description
attachActionSelected

Attaches event handler fnFunction to the actionSelected event of this sap.ui.ux3.ActionBar.

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.ux3.ActionBar itself.

Fired when any of the social action’s toolbar buttons except ‘Update’ or any of the business action’s menu items resp. buttons is pressed. The selected action can be identified by its id and newState (the latter if applicable only) ‘Follow’ button + menu: id: follow, newState: Follow/Hold/Default ‘Mark for follow up’ button: id: flag, newState: true/false ‘Favorite’ button: id: favorite, newState: true/false ‘Open Thing Inspector’ button id: open Business Actions: id: the ThingAction id

For ‘Update’, please refer to event ‘feedSubmit’

attachFeedSubmit

Attaches event handler fnFunction to the feedSubmit event of this sap.ui.ux3.ActionBar.

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.ux3.ActionBar itself.

Fired when a new feed entry is submitted.

closePopups

Closes all popups which might be opened as ActionBar children These are the more- and follow menu and the feeder popup

detachActionSelected

Detaches event handler fnFunction from the actionSelected event of this sap.ui.ux3.ActionBar.

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

detachFeedSubmit

Detaches event handler fnFunction from the feedSubmit event of this sap.ui.ux3.ActionBar.

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

sap.ui.ux3.ActionBar.extend

Creates a new subclass of class sap.ui.ux3.ActionBar 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.

fireActionSelected

Fires event actionSelected to attached listeners.

fireFeedSubmit

Fires event feedSubmit to attached listeners.

getAlwaysShowMoreMenu

Gets current value of property alwaysShowMoreMenu.

If true, business actions are rendered as menu items of the 'More' menu button. Otherwise, 'More' menu button is only displayed for overflow and business actions are rendered as inidividual buttons.

Default value is true.

getBusinessActions

Gets content of aggregation businessActions.

Displayed on the actionBar's right hand-side, either as menu item under 'More' or as individual buttons

getDividerWidth

Gets current value of property dividerWidth.

The minimum width of ActionBar's the social actions part: business action controls have to be rendered outside this area

getFavoriteState

Gets current value of property favoriteState.

Indicates whether “Favorite” is active

getFlagState

Gets current value of property flagState.

Indicates whether “Mark for Follow Up” is active

getFollowState

Gets current value of property followState.

Keeps track of the actionBars Follow/Unfollow button’s state. Its value is one of - FollowActionState.Default - FollowActionState.Follow - FollowActionState.Hold

Default value is Default.

sap.ui.ux3.ActionBar.getMetadata

Returns a metadata object for class sap.ui.ux3.ActionBar.

getShowFavorite

Gets current value of property showFavorite.

Indicates whether social action “Favorite” is shown, default is ‘true’

Default value is true.

getShowFlag

Gets current value of property showFlag.

Indicates whether social action “Mark for Follow Up” is shown, default is ‘true’

Default value is true.

getShowFollow

Gets current value of property showFollow.

Indicates whether social action “Follow” is shown, default is ‘true’

Default value is true.

getShowOpen

Gets current value of property showOpen.

Indicates whether social action “Open” is shown, default is ‘true’

Default value is true.

getShowUpdate

Gets current value of property showUpdate.

Indicates whether social action “Update” is shown, default is ‘true’

Default value is true.

getThingIconURI

Gets current value of property thingIconURI.

The thing icon uri. Icon will be displayed in Feeder

getUpdateState

Gets current value of property updateState.

Indicates whether “Update” is active

indexOfBusinessAction

Checks for the provided sap.ui.ux3.ThingAction in the aggregation businessActions. and returns its index if found or -1 otherwise.

isActive

Checks whether the control is still valid (is in the DOM). ActionBar instance is rendered if and only if 'isActive' returns 'true'. This check is called implicitely by the rendere, MUST not be removed.

setAlwaysShowMoreMenu

Sets a new value for property alwaysShowMoreMenu.

If true, business actions are rendered as menu items of the 'More' menu button. Otherwise, 'More' menu button is only displayed for overflow and business actions are rendered as inidividual buttons.

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

Default value is true.

setDividerWidth

Sets a new value for property dividerWidth.

The minimum width of ActionBar's the social actions part: business action controls have to be rendered outside this area

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

setFavoriteState

Sets a new value for property favoriteState.

Indicates whether “Favorite” is active

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

setFlagState

Sets a new value for property flagState.

Indicates whether “Mark for Follow Up” is active

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

setFollowState

Sets a new value for property followState.

Keeps track of the actionBars Follow/Unfollow button’s state. Its value is one of - FollowActionState.Default - FollowActionState.Follow - FollowActionState.Hold

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

Default value is Default.

setShowFavorite

Sets a new value for property showFavorite.

Indicates whether social action “Favorite” is shown, default is ‘true’

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

Default value is true.

setShowFlag

Sets a new value for property showFlag.

Indicates whether social action “Mark for Follow Up” is shown, default is ‘true’

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

Default value is true.

setShowFollow

Sets a new value for property showFollow.

Indicates whether social action “Follow” is shown, default is ‘true’

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

Default value is true.

setShowOpen

Sets a new value for property showOpen.

Indicates whether social action “Open” is shown, default is ‘true’

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

Default value is true.

setShowUpdate

Sets a new value for property showUpdate.

Indicates whether social action “Update” is shown, default is ‘true’

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

Default value is true.

setThingIconURI

Sets a new value for property thingIconURI.

The thing icon uri. Icon will be displayed in Feeder

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

setUpdateState

Sets a new value for property updateState.

Indicates whether “Update” is active

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

attachActionSelected

Attaches event handler fnFunction to the actionSelected event of this sap.ui.ux3.ActionBar.

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.ux3.ActionBar itself.

Fired when any of the social action’s toolbar buttons except ‘Update’ or any of the business action’s menu items resp. buttons is pressed. The selected action can be identified by its id and newState (the latter if applicable only) ‘Follow’ button + menu: id: follow, newState: Follow/Hold/Default ‘Mark for follow up’ button: id: flag, newState: true/false ‘Favorite’ button: id: favorite, newState: true/false ‘Open Thing Inspector’ button id: open Business Actions: id: the ThingAction id

For ‘Update’, please refer to event ‘feedSubmit’

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.ux3.ActionBar itself

attachFeedSubmit

Attaches event handler fnFunction to the feedSubmit event of this sap.ui.ux3.ActionBar.

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.ux3.ActionBar itself.

Fired when a new feed entry is submitted.

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.ux3.ActionBar itself

closePopups

Closes all popups which might be opened as ActionBar children These are the more- and follow menu and the feeder popup

detachActionSelected

Detaches event handler fnFunction from the actionSelected event of this sap.ui.ux3.ActionBar.

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

detachFeedSubmit

Detaches event handler fnFunction from the feedSubmit event of this sap.ui.ux3.ActionBar.

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.ux3.ActionBar.extend

Creates a new subclass of class sap.ui.ux3.ActionBar 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

fireActionSelected

Fires event actionSelected to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

id string

Id of selected ThingAction

action sap.ui.ux3.ThingAction

Selected ThingAction

newState string

New State of the selected action.Only filled if the respective action maintains a state property, for example 'FollowUp' or 'Favorite'

fireFeedSubmit

Fires event feedSubmit to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

text string

Feed text

getAlwaysShowMoreMenu

Gets current value of property alwaysShowMoreMenu.

If true, business actions are rendered as menu items of the 'More' menu button. Otherwise, 'More' menu button is only displayed for overflow and business actions are rendered as inidividual buttons.

Default value is true.

getBusinessActions

Gets content of aggregation businessActions.

Displayed on the actionBar's right hand-side, either as menu item under 'More' or as individual buttons

getDividerWidth

Gets current value of property dividerWidth.

The minimum width of ActionBar's the social actions part: business action controls have to be rendered outside this area

getFavoriteState

Gets current value of property favoriteState.

Indicates whether “Favorite” is active

getFlagState

Gets current value of property flagState.

Indicates whether “Mark for Follow Up” is active

getFollowState

Gets current value of property followState.

Keeps track of the actionBars Follow/Unfollow button’s state. Its value is one of - FollowActionState.Default - FollowActionState.Follow - FollowActionState.Hold

Default value is Default.

sap.ui.ux3.ActionBar.getMetadata

Returns a metadata object for class sap.ui.ux3.ActionBar.

getShowFavorite

Gets current value of property showFavorite.

Indicates whether social action “Favorite” is shown, default is ‘true’

Default value is true.

getShowFlag

Gets current value of property showFlag.

Indicates whether social action “Mark for Follow Up” is shown, default is ‘true’

Default value is true.

getShowFollow

Gets current value of property showFollow.

Indicates whether social action “Follow” is shown, default is ‘true’

Default value is true.

getShowOpen

Gets current value of property showOpen.

Indicates whether social action “Open” is shown, default is ‘true’

Default value is true.

getShowUpdate

Gets current value of property showUpdate.

Indicates whether social action “Update” is shown, default is ‘true’

Default value is true.

getThingIconURI

Gets current value of property thingIconURI.

The thing icon uri. Icon will be displayed in Feeder

getUpdateState

Gets current value of property updateState.

Indicates whether “Update” is active

indexOfBusinessAction

Checks for the provided sap.ui.ux3.ThingAction in the aggregation businessActions. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oBusinessAction sap.ui.ux3.ThingAction

The businessAction whose index is looked for

isActive

Checks whether the control is still valid (is in the DOM). ActionBar instance is rendered if and only if 'isActive' returns 'true'. This check is called implicitely by the rendere, MUST not be removed.

setAlwaysShowMoreMenu

Sets a new value for property alwaysShowMoreMenu.

If true, business actions are rendered as menu items of the 'More' menu button. Otherwise, 'More' menu button is only displayed for overflow and business actions are rendered as inidividual buttons.

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
bAlwaysShowMoreMenu boolean true

New value for property alwaysShowMoreMenu

setDividerWidth

Sets a new value for property dividerWidth.

The minimum width of ActionBar's the social actions part: business action controls have to be rendered outside this area

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

Param Type DefaultValue Description
sDividerWidth sap.ui.core.CSSSize

New value for property dividerWidth

setFavoriteState

Sets a new value for property favoriteState.

Indicates whether “Favorite” is active

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

Param Type DefaultValue Description
bFavoriteState boolean

New value for property favoriteState

setFlagState

Sets a new value for property flagState.

Indicates whether “Mark for Follow Up” is active

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

Param Type DefaultValue Description
bFlagState boolean

New value for property flagState

setFollowState

Sets a new value for property followState.

Keeps track of the actionBars Follow/Unfollow button’s state. Its value is one of - FollowActionState.Default - FollowActionState.Follow - FollowActionState.Hold

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

Default value is Default.

Param Type DefaultValue Description
sFollowState sap.ui.ux3.FollowActionState Default

New value for property followState

setShowFavorite

Sets a new value for property showFavorite.

Indicates whether social action “Favorite” is shown, default is ‘true’

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
bShowFavorite boolean true

New value for property showFavorite

setShowFlag

Sets a new value for property showFlag.

Indicates whether social action “Mark for Follow Up” is shown, default is ‘true’

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
bShowFlag boolean true

New value for property showFlag

setShowFollow

Sets a new value for property showFollow.

Indicates whether social action “Follow” is shown, default is ‘true’

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
bShowFollow boolean true

New value for property showFollow

setShowOpen

Sets a new value for property showOpen.

Indicates whether social action “Open” is shown, default is ‘true’

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
bShowOpen boolean true

New value for property showOpen

setShowUpdate

Sets a new value for property showUpdate.

Indicates whether social action “Update” is shown, default is ‘true’

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
bShowUpdate boolean true

New value for property showUpdate

setThingIconURI

Sets a new value for property thingIconURI.

The thing icon uri. Icon will be displayed in Feeder

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

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

New value for property thingIconURI

setUpdateState

Sets a new value for property updateState.

Indicates whether “Update” is active

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

Param Type DefaultValue Description
bUpdateState boolean

New value for property updateState