Module: alfresco/forms/controls/CheckBox

alfresco/forms/controls/CheckBox

This the basic checkbox form control. It extends the [BaseFormControl] module:alfresco/forms/controls/BaseFormControl and supports the standard form control configuration. The value can be set as either string or boolean representations of true and false but the returned value will always be a boolean.
Author:
  • Dave Draper
License:
Source:

Members

_hasCustomValues :boolean

Private state variable to store whether custom on/off values were provided.
Type:
  • boolean
Since:
  • 1.0.59
Default Value:
  • false
Source:

cssRequirements :object[]

An array of the CSS files to use with this widget.
Type:
  • object[]
Default Value:
  • [{cssFile:"./css/CheckBox.css"}]
Source:

offValue :*

The value to be returned when the checkbox is not selected. If not specified, the default value is false. If this value is provided then onValue must also be provided.
Type:
  • *
Since:
  • 1.0.59
Default Value:
  • undefined
Source:

onValue :*

The value to be returned when the checkbox is selected. If not specified, the default value is true. If this value is provided then offValue must also be provided.
Type:
  • *
Since:
  • 1.0.59
Default Value:
  • undefined
Source:

Methods

createFormControl()

Source:

getValue() → {boolean}

Gets the checked value of the checkbox.
Source:
Returns:
The checked state of the checkbox
Type
boolean

getWidgetConfig()

Source:

postMixInProperties()

This is called after the properties have been mixed into the widget.
Since:
  • 1.0.59
Source:

setupChangeEvents()

Overrides the inherited function to listen to watch for changes to the "checked" attribute of the CheckBox
Source:

setValue(value)

Sets the checked value of the checkbox.
Parameters:
Name Type Description
value object The value to set.
Source: