class sap.m.SplitButton

Control sample: sap.m.SplitButton
Visiblity: restricted
UX Guidelines:
Implements: sap.m.IOverflowToolbarContent
Available since: N/A
Module: sap/m/SplitButton
Application Component: CA-UI5-CTR

Enables users to trigger actions. For the button UI, you can define some text or an icon, or both.


Constructor

Constructor for a new SplitButton.

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.m.SplitButton(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
activeIcon sap.ui.core.URI

The source property of an alternative icon for the active (pressed) state of the button. Both active and default icon properties should be defined and of the same type - image or icon font. If the icon property is not set or has a different type, the active icon is not displayed.

Visibility: public
enabled boolean true

Boolean property to enable the control (default is true). Note: Depending on custom settings, the buttons that are disabled have other colors than the enabled ones.

Visibility: public
icon sap.ui.core.URI

Defines the icon to be displayed as graphical element within the button. This can be an image or an icon from the icon font.

Visibility: public
iconDensityAware boolean true

When set to truefalse to avoid the attempt of fetching density perfect image.

Visibility: public
text string

Define the text of the button.

Visibility: public
textDirection sap.ui.core.TextDirection Inherit

This property specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.

Visibility: public
type sap.m.ButtonType Default

Defines the type of the button (for example, Default, Accept, Reject, Transparent). Values Back, Up and Unstyled are ignored.

Visibility: public
width sap.ui.core.CSSSize

Defines the width of the button.

Visibility: public

Aggregations

Default Aggregation:

Name Cardinality Type Description
_arrowButton 0..1 sap.m.Button
_textButton 0..1 sap.m.Button

Associations

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

Association to controls / IDs, which describe this control (see WAI-ARIA attribute aria-describedby).

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
arrowPress

Fired when the arrow button is pressed.

press

Fired when the user clicks on the control.

arrowPress

Fired when the arrow button is pressed.

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

press

Fired when the user clicks on the control.

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

Methods Overview

Method Description
addAriaDescribedBy

Adds some ariaDescribedBy into the association ariaDescribedBy.

addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

attachArrowPress

Attaches event handler fnFunction to the arrowPress event of this sap.m.SplitButton.

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.m.SplitButton itself.

Fired when the arrow button is pressed.

attachPress

Attaches event handler fnFunction to the press event of this sap.m.SplitButton.

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.m.SplitButton itself.

Fired when the user clicks on the control.

detachArrowPress

Detaches event handler fnFunction from the arrowPress event of this sap.m.SplitButton.

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

detachPress

Detaches event handler fnFunction from the press event of this sap.m.SplitButton.

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

sap.m.SplitButton.extend

Creates a new subclass of class sap.m.SplitButton 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.

fireArrowPress

Fires event arrowPress to attached listeners.

firePress

Fires event press to attached listeners.

getActiveIcon

Gets current value of property activeIcon.

The source property of an alternative icon for the active (pressed) state of the button. Both active and default icon properties should be defined and of the same type - image or icon font. If the icon property is not set or has a different type, the active icon is not displayed.

getAriaDescribedBy

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

getAriaLabelledBy

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

getEnabled

Gets current value of property enabled.

Boolean property to enable the control (default is true). Note: Depending on custom settings, the buttons that are disabled have other colors than the enabled ones.

Default value is true.

getIcon

Gets current value of property icon.

Defines the icon to be displayed as graphical element within the button. This can be an image or an icon from the icon font.

getIconDensityAware

Gets current value of property iconDensityAware.

When set to truefalse to avoid the attempt of fetching density perfect image.

Default value is true.

sap.m.SplitButton.getMetadata

Returns a metadata object for class sap.m.SplitButton.

getText

Gets current value of property text.

Define the text of the button.

getTextDirection

Gets current value of property textDirection.

This property specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.

Default value is Inherit.

getType

Gets current value of property type.

Defines the type of the button (for example, Default, Accept, Reject, Transparent). Values Back, Up and Unstyled are ignored.

Default value is Default.

getWidth

Gets current value of property width.

Defines the width of the button.

removeAllAriaDescribedBy

Removes all the controls in the association named ariaDescribedBy.

removeAllAriaLabelledBy

Removes all the controls in the association named ariaLabelledBy.

removeAriaDescribedBy

Removes an ariaDescribedBy from the association named ariaDescribedBy.

removeAriaLabelledBy

Removes an ariaLabelledBy from the association named ariaLabelledBy.

setActiveIcon

Sets a new value for property activeIcon.

The source property of an alternative icon for the active (pressed) state of the button. Both active and default icon properties should be defined and of the same type - image or icon font. If the icon property is not set or has a different type, the active icon is not displayed.

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

setArrowState

Sets the arrow state to down or not down.

setEnabled

Sets a new value for property enabled.

Boolean property to enable the control (default is true). Note: Depending on custom settings, the buttons that are disabled have other colors than the enabled ones.

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

Default value is true.

setIcon

Sets a new value for property icon.

Defines the icon to be displayed as graphical element within the button. This can be an image or an icon from the icon font.

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

setIconDensityAware

Sets a new value for property iconDensityAware.

When set to truefalse to avoid the attempt of fetching density perfect image.

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

Default value is true.

setText

Sets a new value for property text.

Define the text of the button.

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

setTextDirection

Sets a new value for property textDirection.

This property specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.

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

Default value is Inherit.

setType

Sets a new value for property type.

Defines the type of the button (for example, Default, Accept, Reject, Transparent). Values Back, Up and Unstyled are ignored.

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

Default value is Default.

setWidth

Sets a new value for property width.

Defines the width of the button.

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

addAriaDescribedBy

Adds some ariaDescribedBy into the association ariaDescribedBy.

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

The ariaDescribedBy to add; if empty, nothing is inserted

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

attachArrowPress

Attaches event handler fnFunction to the arrowPress event of this sap.m.SplitButton.

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.m.SplitButton itself.

Fired when the arrow button is pressed.

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.m.SplitButton itself

attachPress

Attaches event handler fnFunction to the press event of this sap.m.SplitButton.

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.m.SplitButton itself.

Fired when the user clicks 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.m.SplitButton itself

detachArrowPress

Detaches event handler fnFunction from the arrowPress event of this sap.m.SplitButton.

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

detachPress

Detaches event handler fnFunction from the press event of this sap.m.SplitButton.

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.m.SplitButton.extend

Creates a new subclass of class sap.m.SplitButton 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

fireArrowPress

Fires event arrowPress to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

firePress

Fires event press to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

getActiveIcon

Gets current value of property activeIcon.

The source property of an alternative icon for the active (pressed) state of the button. Both active and default icon properties should be defined and of the same type - image or icon font. If the icon property is not set or has a different type, the active icon is not displayed.

getAriaDescribedBy

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

getAriaLabelledBy

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

getEnabled

Gets current value of property enabled.

Boolean property to enable the control (default is true). Note: Depending on custom settings, the buttons that are disabled have other colors than the enabled ones.

Default value is true.

getIcon

Gets current value of property icon.

Defines the icon to be displayed as graphical element within the button. This can be an image or an icon from the icon font.

getIconDensityAware

Gets current value of property iconDensityAware.

When set to truefalse to avoid the attempt of fetching density perfect image.

Default value is true.

sap.m.SplitButton.getMetadata

Returns a metadata object for class sap.m.SplitButton.

getText

Gets current value of property text.

Define the text of the button.

getTextDirection

Gets current value of property textDirection.

This property specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.

Default value is Inherit.

getType

Gets current value of property type.

Defines the type of the button (for example, Default, Accept, Reject, Transparent). Values Back, Up and Unstyled are ignored.

Default value is Default.

getWidth

Gets current value of property width.

Defines the width of the button.

removeAllAriaDescribedBy

Removes all the controls in the association named ariaDescribedBy.

removeAllAriaLabelledBy

Removes all the controls in the association named ariaLabelledBy.

removeAriaDescribedBy

Removes an ariaDescribedBy from the association named ariaDescribedBy.

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

The ariaDescribedBy to be removed or its index or ID

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

setActiveIcon

Sets a new value for property activeIcon.

The source property of an alternative icon for the active (pressed) state of the button. Both active and default icon properties should be defined and of the same type - image or icon font. If the icon property is not set or has a different type, the active icon is not displayed.

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

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

New value for property activeIcon

setArrowState

Sets the arrow state to down or not down.

Param Type DefaultValue Description
bIsDown boolean

Is the arrow down

setEnabled

Sets a new value for property enabled.

Boolean property to enable the control (default is true). Note: Depending on custom settings, the buttons that are disabled have other colors than the enabled ones.

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

New value for property enabled

setIcon

Sets a new value for property icon.

Defines the icon to be displayed as graphical element within the button. This can be an image or an icon from the icon font.

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

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

New value for property icon

setIconDensityAware

Sets a new value for property iconDensityAware.

When set to truefalse to avoid the attempt of fetching density perfect image.

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

New value for property iconDensityAware

setText

Sets a new value for property text.

Define the text of the button.

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

Param Type DefaultValue Description
sText string

New value for property text

setTextDirection

Sets a new value for property textDirection.

This property specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.

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

Default value is Inherit.

Param Type DefaultValue Description
sTextDirection sap.ui.core.TextDirection Inherit

New value for property textDirection

setType

Sets a new value for property type.

Defines the type of the button (for example, Default, Accept, Reject, Transparent). Values Back, Up and Unstyled are ignored.

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
sType sap.m.ButtonType Default

New value for property type

setWidth

Sets a new value for property width.

Defines the width of the button.

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

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

New value for property width