TriStateCheckBox to reflect mixed state for checkboxes. The control can display three states, namely checked, unchecked and mixed. However, mixed state cannot be directly reached by user interaction on the particular control. It can be only set by the control's public toggle function, to make a behaviour possible which is e.g. required in checkbox trees.
Constructor for a new TriStateCheckBox.
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.TriStateCheckBox(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 |
---|---|---|---|
editable | boolean | true | Specifies whether the user shall be allowed to flag the check box Visibility: public |
enabled | boolean | true | Using this property, the control could be disabled, if required. Visibility: public |
selectionState | sap.ui.commons.TriStateCheckBoxState | Unchecked | Defines the states of the checkbox 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 |
Event | Description |
---|---|
change |
Event is triggered when the control status is changed by the user by flagging or unflagging the checkbox. |
Method | Description |
---|---|
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. |
detachChange |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.ui.commons.TriStateCheckBox.extend |
Creates a new subclass of class sap.ui.commons.TriStateCheckBox with name
|
fireChange |
Fires event change to attached listeners. |
getEditable |
Gets current value of property editable. Specifies whether the user shall be allowed to flag 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.TriStateCheckBox.getMetadata |
Returns a metadata object for class sap.ui.commons.TriStateCheckBox. |
getSelectionState |
Gets current value of property selectionState. Defines the states of the checkbox Default value is |
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. |
setEditable |
Sets a new value for property editable. Specifies whether the user shall be allowed to flag 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 |
setSelectionState |
Sets a new value for property selectionState. Defines the states of the checkbox When called with a value of Default value is |
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 |
Method called whenever a user clicks on a tri-state checkbox |
Attaches event handler fnFunction
to the change event of this sap.ui.commons.TriStateCheckBox
.
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.TriStateCheckBox
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 |
Detaches event handler fnFunction
from the change event of this sap.ui.commons.TriStateCheckBox
.
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.TriStateCheckBox 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 |
|
selectionState | string |
Checks whether the box is flagged or not flagged. |
Gets current value of property editable.
Specifies whether the user shall be allowed to flag 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
.
Returns a metadata object for class sap.ui.commons.TriStateCheckBox.
Gets current value of property selectionState.
Defines the states of the checkbox
Default value is Unchecked
.
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.
Sets a new value for property editable.
Specifies whether the user shall be allowed to flag 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 selectionState.
Defines the states of the checkbox
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Unchecked
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sSelectionState | sap.ui.commons.TriStateCheckBoxState | Unchecked |
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 |
Method called whenever a user clicks on a tri-state checkbox
Param | Type | DefaultValue | Description |
---|---|---|---|
destState | sap.ui.commons.TriStateCheckBoxState |
destined selection state of checkbox |