src/aria/widgets/form/TextInput.js
function (enable, value, updateState) {
            var cfg = this._cfg, prefillText;
            // check for disposal
            if (!cfg) {
                return;
            }
            var field = this.getTextInputField();
            if (enable) {
                if (!field || (field.value && !this._helpTextSet && !this._isPrefilled)) {
                    return;
                }

                this.setHelpText(false);

                if (value == null) {
                    prefillText = "";
                } else {
                    prefillText = this._getPrefilledText(value);
                }
                if (cfg.prefillError) {
                    prefillText = "";
                }
                if (!prefillText) {
                    field.value = prefillText;
                    this._isPrefilled = false;
                    this.setHelpText(true);
                    this._updateState();
                } else {
                    this._isPrefilled = true;
                    // update field value
                    field.value = prefillText;
                }

            } else {
                this._isPrefilled = false;
            }
            if (updateState) {
                if (!(enable && this._state == "prefill")) {
                    this._updateState();
                }
            }
        }
function (enable, value, updateState) {
            var cfg = this._cfg, prefillText;
            // check for disposal
            if (!cfg) {
                return;
            }
            var field = this.getTextInputField();
            if (enable) {
                if (!field || (field.value && !this._helpTextSet && !this._isPrefilled)) {
                    return;
                }

                this.setHelpText(false);

                if (value == null) {
                    prefillText = "";
                } else {
                    prefillText = this._getPrefilledText(value);
                }
                if (cfg.prefillError) {
                    prefillText = "";
                }
                if (!prefillText) {
                    field.value = prefillText;
                    this._isPrefilled = false;
                    this.setHelpText(true);
                    this._updateState();
                } else {
                    this._isPrefilled = true;
                    // update field value
                    field.value = prefillText;
                }

            } else {
                this._isPrefilled = false;
            }
            if (updateState) {
                if (!(enable && this._state == "prefill")) {
                    this._updateState();
                }
            }
        }
function ( enable , value , updateState ) { var cfg = this . _cfg , prefillText ; // check for disposal if ( ! cfg ) { return ; } var field = this . getTextInputField ( ) ; if ( enable ) { if ( ! field || ( field . value && ! this . _helpTextSet && ! this . _isPrefilled ) ) { return ; } this . setHelpText ( false ) ; if ( value == null ) { prefillText = "" ; } else { prefillText = this . _getPrefilledText ( value ) ; } if ( cfg . prefillError ) { prefillText = "" ; } if ( ! prefillText ) { field . value = prefillText ; this . _isPrefilled = false ; this . setHelpText ( true ) ; this . _updateState ( ) ; } else { this . _isPrefilled = true ; // update field value field . value = prefillText ; } } else { this . _isPrefilled = false ; } if ( updateState ) { if ( ! ( enable && this . _state == "prefill" ) ) { this . _updateState ( ) ; } } }
Set the prefill text of the field if needed
@param {Boolean} enable false if you want to leave the prefill state
@param {String|Array} value optional string (or array for the multiselect) to fill the field with
@param {Boolean} updateState if true a state update is triggered at the end
Set the prefill text of the field if needed