Class sap.ui.commons.ToggleButtonModule: sap/ui/commons/ToggleButton

extends Button

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

Deprecated API:Since version 1.38. Instead, use the sap.m.ToggleButton control.

Constructor Summary
new sap.ui.commons.ToggleButton(sId?, mSettings?)Constructor for a new ToggleButton.
Events borrowed from class sap.ui.commons.Button
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.commons.ToggleButton.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.commons.ToggleButton with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.commons.ToggleButton.getMetadata()Returns a metadata object for class sap.ui.commons.ToggleButton.
getPressed()Gets current value of property pressed.
setPressed(bPressed)Sets a new value for property pressed.
Constructor Detail
new sap.ui.commons.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.ui.commons.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
Deprecated:
Since version 1.38. Instead, use the sap.m.ToggleButton control.
Method Detail
sap.ui.commons.ToggleButton.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.commons.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.ui.commons.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.ui.commons.ToggleButton.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.commons.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.ui.commons.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.ui.commons.ToggleButton} Reference to this in order to allow method chaining