class sap.m.SegmentedButtonItem

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

Used for creating buttons for the sap.m.SegmentedButton. It is derived from the sap.ui.core.Item.


Constructor

Constructor for a new SegmentedButtonItem.

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.SegmentedButtonItem(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
icon string

The icon, which belongs to the button. This can be a URI to an image or an icon font URI.

Visibility: public
visible boolean true

Whether the button should be visible on the screen. If set to false, a placeholder is rendered instead of the real button.

Visibility: public
width sap.ui.core.CSSSize

Sets the width of the buttons.

Visibility: public

Events Overview

Event Description
press

Fires when the user clicks on an individual button.

press

Fires when the user clicks on an individual button.

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

Methods Overview

Method Description
attachPress

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

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

Fires when the user clicks on an individual button.

detachPress

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

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

exit

Cleanup

sap.m.SegmentedButtonItem.extend

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

firePress

Fires event press to attached listeners.

getIcon

Gets current value of property icon.

The icon, which belongs to the button. This can be a URI to an image or an icon font URI.

sap.m.SegmentedButtonItem.getMetadata

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

getVisible

Gets current value of property visible.

Whether the button should be visible on the screen. If set to false, a placeholder is rendered instead of the real button.

Default value is true.

getWidth

Gets current value of property width.

Sets the width of the buttons.

init

Called once during the element's initialization

setIcon

Sets a new value for property icon.

The icon, which belongs to the button. This can be a URI to an image or an icon font URI.

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

setVisible

Sets a new value for property visible.

Whether the button should be visible on the screen. If set to false, a placeholder is rendered instead of the real button.

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

Default value is true.

setWidth

Sets a new value for property width.

Sets the width of the buttons.

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

attachPress

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

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

Fires when the user clicks on an individual 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.m.SegmentedButtonItem itself

detachPress

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

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

exit

Cleanup

sap.m.SegmentedButtonItem.extend

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

getIcon

Gets current value of property icon.

The icon, which belongs to the button. This can be a URI to an image or an icon font URI.

sap.m.SegmentedButtonItem.getMetadata

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

getVisible

Gets current value of property visible.

Whether the button should be visible on the screen. If set to false, a placeholder is rendered instead of the real button.

Default value is true.

getWidth

Gets current value of property width.

Sets the width of the buttons.

init

Called once during the element's initialization

setIcon

Sets a new value for property icon.

The icon, which belongs to the button. This can be a URI to an image or an icon font URI.

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

Param Type DefaultValue Description
sIcon string

New value for property icon

setVisible

Sets a new value for property visible.

Whether the button should be visible on the screen. If set to false, a placeholder is rendered instead of the real button.

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

New value for property visible

setWidth

Sets a new value for property width.

Sets the width of the buttons.

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