src/aria/widgets/form/CheckBox.js
function () {

            var newState = this._state;

            if (this._icon) {
                this._icon.changeIcon(this._getIconName(newState));
            }

            var inpEl = this._getFocusableElement();
            if (inpEl != null) {
                var hasWaiWorkaroundMarkup = this._hasWaiWorkaroundMarkup;
                var needWaiWorkaroundMarkup = this._needWaiWorkaroundMarkup();
                if (hasWaiWorkaroundMarkup || needWaiWorkaroundMarkup) {
                    // Jaws has some issues with disabled check boxes
                    // (cf test.aria.widgets.wai.input.checkbox.CheckboxDisabledJawsTestCase)
                    if (this._hasTwoInputs) {
                        aria.utils.Dom.removeElement(inpEl.nextSibling);
                    }
                    var markup = this._getInputsMarkup();
                    aria.utils.Dom.insertAdjacentHTML(inpEl, "afterEnd", markup);
                    aria.utils.Dom.removeElement(inpEl);
                    this._initializeFocusableElement();
                    inpEl = this._getFocusableElement();
                } else {
                    var disabled = this.getProperty("disabled");
                    var selected = this._isChecked();
                    inpEl.checked = selected;
                    inpEl.value = selected ? "true" : "false";
                    inpEl.disabled = disabled;
                }
            }

            if (this._label != null) {
                try {
                    // This call throws an exception when the color is 'inherit'
                    // and the browser or the browser mode is IE7
                    this._label.style.color = this._skinObj.states[newState].color;
                } catch (ex) {
                    this._label.style.color = "";
                }
            }

        }
function () {

            var newState = this._state;

            if (this._icon) {
                this._icon.changeIcon(this._getIconName(newState));
            }

            var inpEl = this._getFocusableElement();
            if (inpEl != null) {
                var hasWaiWorkaroundMarkup = this._hasWaiWorkaroundMarkup;
                var needWaiWorkaroundMarkup = this._needWaiWorkaroundMarkup();
                if (hasWaiWorkaroundMarkup || needWaiWorkaroundMarkup) {
                    // Jaws has some issues with disabled check boxes
                    // (cf test.aria.widgets.wai.input.checkbox.CheckboxDisabledJawsTestCase)
                    if (this._hasTwoInputs) {
                        aria.utils.Dom.removeElement(inpEl.nextSibling);
                    }
                    var markup = this._getInputsMarkup();
                    aria.utils.Dom.insertAdjacentHTML(inpEl, "afterEnd", markup);
                    aria.utils.Dom.removeElement(inpEl);
                    this._initializeFocusableElement();
                    inpEl = this._getFocusableElement();
                } else {
                    var disabled = this.getProperty("disabled");
                    var selected = this._isChecked();
                    inpEl.checked = selected;
                    inpEl.value = selected ? "true" : "false";
                    inpEl.disabled = disabled;
                }
            }

            if (this._label != null) {
                try {
                    // This call throws an exception when the color is 'inherit'
                    // and the browser or the browser mode is IE7
                    this._label.style.color = this._skinObj.states[newState].color;
                } catch (ex) {
                    this._label.style.color = "";
                }
            }

        }
function ( ) { var newState = this . _state ; if ( this . _icon ) { this . _icon . changeIcon ( this . _getIconName ( newState ) ) ; } var inpEl = this . _getFocusableElement ( ) ; if ( inpEl != null ) { var hasWaiWorkaroundMarkup = this . _hasWaiWorkaroundMarkup ; var needWaiWorkaroundMarkup = this . _needWaiWorkaroundMarkup ( ) ; if ( hasWaiWorkaroundMarkup || needWaiWorkaroundMarkup ) { // Jaws has some issues with disabled check boxes // (cf test.aria.widgets.wai.input.checkbox.CheckboxDisabledJawsTestCase) if ( this . _hasTwoInputs ) { aria . utils . Dom . removeElement ( inpEl . nextSibling ) ; } var markup = this . _getInputsMarkup ( ) ; aria . utils . Dom . insertAdjacentHTML ( inpEl , "afterEnd" , markup ) ; aria . utils . Dom . removeElement ( inpEl ) ; this . _initializeFocusableElement ( ) ; inpEl = this . _getFocusableElement ( ) ; } else { var disabled = this . getProperty ( "disabled" ) ; var selected = this . _isChecked ( ) ; inpEl . checked = selected ; inpEl . value = selected ? "true" : "false" ; inpEl . disabled = disabled ; } } if ( this . _label != null ) { try { // This call throws an exception when the color is 'inherit' // and the browser or the browser mode is IE7 this . _label . style . color = this . _skinObj . states [ newState ] . color ; } catch ( ex ) { this . _label . style . color = "" ; } } }
Internal method to change the state of the checkbox
@protected
Internal method to change the state of the checkbox