Will set the appropriate value for the option in state, view, and the hidden form select, and emit an event
@param {String} optionValue
770578
function setSelectedOption(optionValue) {
    const newOptionSelected = this.state.options.filter(option => option.value.toString() === optionValue)[0];
    const newOptionSelectedValue = newOptionSelected && newOptionSelected.value;
    let options = this.clearListboxSelections(this.state.options);

    options = options.map(option => {
        if (option.value === newOptionSelectedValue) {
            option.selected = true;
            this.setState('selected', option);
            this.update();
        }
        return option;
    });

    this.setState('options', options);
}
265324
@SuppressWarnings({ "unchecked", "rawtypes" })
    public <T> B option(ClientOptionValue<T> optionValue) {
        requireNonNull(optionValue, "optionValue");
        final ClientOption<?> opt = optionValue.option();
        if (opt == ClientOption.DECORATION) {
            final ClientDecoration d = (ClientDecoration) optionValue.value();
            d.entries().forEach(e -> decoration.add0(e.requestType(), e.responseType(),
                                                     (Function) e.decorator()));
        } else if (opt == ClientOption.HTTP_HEADERS) {
            final HttpHeaders h = (HttpHeaders) optionValue.value();
            setHttpHeaders(h);
        } else {
            options.put(opt, optionValue);
        }
        return self();
    }
308935
public void onValueChange(ValueChangeEvent<String> event) {

        String message = null;
        boolean enableOk = true;
        if (m_isCreateNew) {
            if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_fileName.getFormValueAsString())) {
                enableOk = false;
                message = Messages.get().key(Messages.GUI_EDIT_LINK_NO_FILE_NAME_0);
            } else if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_linkContent.getFormValueAsString())) {
                enableOk = false;
                message = Messages.get().key(Messages.GUI_EDIT_LINK_NO_LINK_0);
            }
        } else {
            if ((m_linkContent.getFormValueAsString().equals(m_previousLink)
                && (m_linkTitle.getFormValueAsString().equals(m_previousTitle)))) {
                enableOk = false;
                message = Messages.get().key(Messages.GUI_EDIT_LINK_NO_CHANGES_0);
            } else if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_linkContent.getFormValueAsString())) {
                enableOk = false;
                message = Messages.get().key(Messages.GUI_EDIT_LINK_NO_LINK_0);
            }
        }
        setOkEnabled(enableOk, message);
    }
1096153
public <T> void set(Option<T> option, T value) {
        findOption(option).setValue(value);
    }
97653
function(option, inputValue) {
		var optVal = option.value.toLowerCase(),
			inptVal = inputValue.toLowerCase(),
			label = option.getAttribute('label'),
			text = option.text.toLowerCase();

		/*
		"Each option element that is a descendant of the datalist element, that is not disabled, and whose value is a string that isn't the empty string, represents a suggestion. Each suggestion has a value and a label."
		"If appropriate, the user agent should use the suggestion's label and value to identify the suggestion to the user."
		*/
		return Boolean(
			option.disabled === false &&
				((optVal !== '' && optVal.indexOf(inptVal) !== -1) ||
					(label && label.toLowerCase().indexOf(inptVal) !== -1) ||
					(text !== '' && text.indexOf(inptVal) !== -1))
		);
	}
399738
public void setValueVisible(final boolean VISIBLE) {
        if (null == valueVisible) {
            _valueVisible = VISIBLE;
            fireUpdateEvent(VISIBILITY_EVENT);
        } else {
            valueVisible.set(VISIBLE);
        }
    }
276467
function setValue($value) {
        $values = (array) $value;
        foreach ($values as $onevalue) {
            if (($this->tags || $this->ajax) &&
                    (!$this->optionExists($onevalue)) &&
                    ($onevalue !== '_qf__force_multiselect_submission')) {
                $this->addOption($onevalue, $onevalue);
            }
        }
        return parent::setValue($value);
    }
1114556
public void setValueVisible(final boolean VISIBLE) {
        if (null == valueVisible) {
            _valueVisible = VISIBLE;
            fireTileEvent(VISIBILITY_EVENT);
        } else {
            valueVisible.set(VISIBLE);
        }
    }
789039
function handleOptionClick(event) {
    let el;

    // find the element with the data
    // start with the target element
    if (event.target.dataset.optionValue) {
        el = event.target;
    // check up the tree one level (in case option text or status was clicked)
    } else if (event.target.parentNode.dataset.optionValue) {
        el = event.target.parentNode;
    }

    this.processAfterStateChange(el);
    this.expander.collapse();
    this.el.querySelector(comboboxHostSelector).focus();
}
1027692
public void setPreventResponseFlush(String configValue) {

        OpenCms.getSystemInfo().getServletContainerSettings().setPreventResponseFlush(
            Boolean.valueOf(configValue).booleanValue());
    }
162712
@Override
    public void setValue(String value, boolean fireEvents) {
        String oldValue = fireEvents ? getValue() : null;
        boolean changed = false;
        for (JQMRadio r : radios) { // first we have to uncheck already checked radios (UI refresh issue)
            TextBox radio = r.getInput();
            if (!isChecked(radio)) continue;
            boolean checked = value != null && value.equals(radio.getValue()) ? true : false;
            if (!checked) {
                setChecked(radio, false);
                changed = true;
            }
        }
        for (JQMRadio r : radios) {
            TextBox radio = r.getInput();
            boolean checked = value != null && value.equals(radio.getValue()) ? true : false;
            if (isChecked(radio) != checked) {
                setChecked(radio, checked);
                changed = true;
            }
        }
        if (fireEvents && changed) {
            String newValue = getValue();
            boolean eq = newValue == oldValue || newValue != null && newValue.equals(oldValue);
            if (!eq) {
                SelectionEvent.fire(this, newValue);
                ValueChangeEvent.fire(this, newValue);
            }
        }
    }
758836
@SuppressWarnings("unchecked")
    private UNode optionValueToUNode(String optName, Object optValue) {
        if (!(optValue instanceof Map)) {
            if (optValue == null) {
                optValue = "";
            }
            return UNode.createValueNode(optName, optValue.toString(), "option");
        }
        UNode optNode = UNode.createMapNode(optName, "option");
        Map<String, Object> suboptMap = (Map<String,Object>)optValue;
        for (String suboptName : suboptMap.keySet()) {
            optNode.addChildNode(optionValueToUNode(suboptName, suboptMap.get(suboptName)));
        }
        return optNode;
    }
645230
@Override
    public void setValue(Boolean value, boolean fireEvents) {
        boolean oldValue = getValue();
        if (value) {
            input.getElement().setAttribute("checked", "true");
        } else {
            input.getElement().removeAttribute("checked");
        }

        if (fireEvents && oldValue != value) {
            ValueChangeEvent.fire(this, getValue());
        }
    }
1362549
@Override
    public void setValue(Object value) throws WidgetException {
        try {
            if (value instanceof String) {
                Select select = new Select(getByLocator());
                select.selectOption((String) value);
            } else {
                throw new WidgetRuntimeException("value must be a String type", getByLocator());
            }
        } catch (Exception e) {
            throw new WidgetException("Error while seleting option on drop down", getByLocator(), e);
        }
    }
264112
def set_option(self, name, value):
        """"""
        _assert_value_is_valid(name)
        self._options[name] = value
987430
function (target, value, text) {
			var inst = this._getInst(target),
				onChange = this._get(inst, 'onChange');
			$("#sbSelector_" + inst.uid).text(text);
			$(target).find("option[value='" + value + "']").attr("selected", TRUE);
			if (onChange) {
				onChange.apply((inst.input ? inst.input[0] : null), [value, inst]);
			} else if (inst.input) {
				inst.input.trigger('change');
			}
		}
702099
public static function setOptionalValue( Option &$option, $arg )
    {
        if ( !self::isShortCode( $arg ) && !self::isLongCode( $arg ) )
        {
            if ( is_bool( $arg ) )
            {
                $option->value = ( bool )$arg;
            }
            elseif ( is_string( $arg ) )
            {
                $arg = trim( $arg );
            
                $option->value = $arg;
            }
        }
    }