Used for creating buttons for the sap.m.SegmentedButton. It is derived from the sap.ui.core.Item.
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 |
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 |
Method | Description |
---|---|
attachPress |
Attaches event handler When called, the context of the event handler (its Fires when the user clicks on an individual button. |
detachPress |
Detaches event handler 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
|
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 |
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 |
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 Default value is |
setWidth |
Sets a new value for property width. Sets the width of the buttons. When called with a value of |
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 |
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 |
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 |
Fires event press to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
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.
Returns a metadata object for class sap.m.SegmentedButtonItem.
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
.
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 |
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 |
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 |