Provides a box which can be flagged, the box has a label. A check box can either stand alone, or in a group with other check boxes. As an option, the boxes can initially be set to status 'Not Editable'.
Constructor for a new CheckBox.
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.ui.commons.CheckBox(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 |
---|---|---|---|
checked | boolean | false | Contains the state of the control whether it is flagged with a check mark, or not Visibility: public |
editable | boolean | true | Specifies whether the user shall be allowed to select the check box. Visibility: public |
enabled | boolean | true | Using this property, the control could be disabled, if required. Visibility: public |
name | string | The 'name' property to be used in the HTML code, for example for HTML forms that send data to the server via submit. Visibility: public |
|
text | string | Defines the text displayed next to the check box Visibility: public |
|
textDirection | sap.ui.core.TextDirection | Inherit | The value can be set to LTR or RTL. Otherwise, the control inherits the text direction from its parent control. Visibility: public |
valueState | sap.ui.core.ValueState | None | Accepts the core enumeration ValueState.type that supports 'None', 'Error', 'Warning' and 'Success'. Visibility: public |
width | sap.ui.core.CSSSize | The width can be set to an absolute value. If no value is set, the control width results from the text length. Visibility: public |
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). |
Event | Description |
---|---|
change |
Event is triggered when the control status is changed by the user by flagging or unflagging the checkbox. |
Method | Description |
---|---|
addAriaDescribedBy |
Adds some ariaDescribedBy into the association ariaDescribedBy. |
addAriaLabelledBy |
Adds some ariaLabelledBy into the association ariaLabelledBy. |
attachChange |
Attaches event handler When called, the context of the event handler (its Event is triggered when the control status is changed by the user by flagging or unflagging the checkbox. |
bindChecked |
Binds property checked to model data. See ManagedObject.bindProperty for a detailed description of the possible properties of |
detachChange |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.ui.commons.CheckBox.extend |
Creates a new subclass of class sap.ui.commons.CheckBox with name
|
fireChange |
Fires event change to attached listeners. |
getAccessibilityInfo |
References:
|
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. |
getChecked |
Gets current value of property checked. Contains the state of the control whether it is flagged with a check mark, or not Default value is |
getEditable |
Gets current value of property editable. Specifies whether the user shall be allowed to select the check box. Default value is |
getEnabled |
Gets current value of property enabled. Using this property, the control could be disabled, if required. Default value is |
sap.ui.commons.CheckBox.getMetadata |
Returns a metadata object for class sap.ui.commons.CheckBox. |
getName |
Gets current value of property name. The 'name' property to be used in the HTML code, for example for HTML forms that send data to the server via submit. |
getText |
Gets current value of property text. Defines the text displayed next to the check box |
getTextDirection |
Gets current value of property textDirection. The value can be set to LTR or RTL. Otherwise, the control inherits the text direction from its parent control. Default value is |
getValueState |
Gets current value of property valueState. Accepts the core enumeration ValueState.type that supports 'None', 'Error', 'Warning' and 'Success'. Default value is |
getWidth |
Gets current value of property width. The width can be set to an absolute value. If no value is set, the control width results from the text length. |
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. |
setChecked |
Sets a new value for property checked. Contains the state of the control whether it is flagged with a check mark, or not When called with a value of Default value is |
setEditable |
Sets a new value for property editable. Specifies whether the user shall be allowed to select the check box. When called with a value of Default value is |
setEnabled |
Sets a new value for property enabled. Using this property, the control could be disabled, if required. When called with a value of Default value is |
setName |
Sets a new value for property name. The 'name' property to be used in the HTML code, for example for HTML forms that send data to the server via submit. When called with a value of |
setText |
Sets a new value for property text. Defines the text displayed next to the check box When called with a value of |
setTextDirection |
Sets a new value for property textDirection. The value can be set to LTR or RTL. Otherwise, the control inherits the text direction from its parent control. When called with a value of Default value is |
setValueState |
Sets a new value for property valueState. Accepts the core enumeration ValueState.type that supports 'None', 'Error', 'Warning' and 'Success'. When called with a value of Default value is |
setWidth |
Sets a new value for property width. The width can be set to an absolute value. If no value is set, the control width results from the text length. When called with a value of |
toggle |
Inverts the current value of the control. |
unbindChecked |
Unbinds property checked from model data. |
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 |
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 |
Attaches event handler fnFunction
to the change event of this sap.ui.commons.CheckBox
.
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.ui.commons.CheckBox
itself.
Event is triggered when the control status is changed by the user by flagging or unflagging the checkbox.
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 |
Binds property checked to model data.
See ManagedObject.bindProperty for a detailed description of the possible properties of oBindingInfo
Param | Type | DefaultValue | Description |
---|---|---|---|
oBindingInfo | sap.ui.base.ManagedObject.PropertyBindingInfo |
The binding information |
Detaches event handler fnFunction
from the change event of this sap.ui.commons.CheckBox
.
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.ui.commons.CheckBox 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 |
Fires event change to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
checked | boolean |
Checks whether the box is flagged or not flagged. |
Returns array of IDs of the elements which are the current targets of the association ariaDescribedBy.
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Gets current value of property checked.
Contains the state of the control whether it is flagged with a check mark, or not
Default value is false
.
Gets current value of property editable.
Specifies whether the user shall be allowed to select the check box.
Default value is true
.
Gets current value of property enabled.
Using this property, the control could be disabled, if required.
Default value is true
.
Gets current value of property name.
The 'name' property to be used in the HTML code, for example for HTML forms that send data to the server via submit.
Gets current value of property textDirection.
The value can be set to LTR or RTL. Otherwise, the control inherits the text direction from its parent control.
Default value is Inherit
.
Gets current value of property valueState.
Accepts the core enumeration ValueState.type that supports 'None', 'Error', 'Warning' and 'Success'.
Default value is None
.
Gets current value of property width.
The width can be set to an absolute value. If no value is set, the control width results from the text length.
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 |
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 |
Sets a new value for property checked.
Contains the state of the control whether it is flagged with a check mark, or not
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bChecked | boolean | false |
New value for property |
Sets a new value for property editable.
Specifies whether the user shall be allowed to select the check box.
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 |
---|---|---|---|
bEditable | boolean | true |
New value for property |
Sets a new value for property enabled.
Using this property, the control could be disabled, if required.
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 |
Sets a new value for property name.
The 'name' property to be used in the HTML code, for example for HTML forms that send data to the server via submit.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sName | string |
New value for property |
Sets a new value for property text.
Defines the text displayed next to the check box
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 |
Sets a new value for property textDirection.
The value can be set to LTR or RTL. Otherwise, the control inherits the text direction from its parent control.
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 |
Sets a new value for property valueState.
Accepts the core enumeration ValueState.type that supports 'None', 'Error', 'Warning' and 'Success'.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is None
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sValueState | sap.ui.core.ValueState | None |
New value for property |
Sets a new value for property width.
The width can be set to an absolute value. If no value is set, the control width results from the text length.
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 |