Class sap.m.ToggleButtonModule: sap/m/ToggleButton

extends Button

The ToggleButton Control is a Button that can be toggled between pressed and normal state

Constructor Summary
new sap.m.ToggleButton(sId?, mSettings?)Constructor for a new ToggleButton.
Events borrowed from class sap.m.Button
Events borrowed from class sap.ui.core.Control
Method Summary
sap.m.ToggleButton.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.ToggleButton with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.ToggleButton.getMetadata()Returns a metadata object for class sap.m.ToggleButton.
getPressed()Gets current value of property pressed.
setPressed(bPressed)Sets a new value for property pressed.
Constructor Detail
new sap.m.ToggleButton(sId?, mSettings?)
Constructor for a new ToggleButton.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.

The supported settings are:

  • Properties

In addition, all settings applicable to the base type sap.m.Button can be used as well.

Parameters:
{string}sId? id for the new control, generated automatically if no id is given
{object}mSettings? initial settings for the new control
Method Detail
sap.m.ToggleButton.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.ToggleButton with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.m.Button.extend.

Parameters:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.m.ToggleButton.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.ToggleButton.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
getAccessibilityInfo()
See:
{sap.ui.core.Control#getAccessibilityInfo}
getPressed(): boolean
Gets current value of property pressed.

The property is “true” when the control is toggled. The default state of this property is "false".

Default value is false.

Returns:
{boolean} Value of property pressed
setPressed(bPressed): sap.m.ToggleButton
Sets a new value for property pressed.

The property is “true” when the control is toggled. The default state of this property is "false".

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

Default value is false.

Parameters:
{boolean}bPressed New value for property pressed
Returns:
{sap.m.ToggleButton} Reference to this in order to allow method chaining