src/aria/widgets/form/list/ListController.js
function (newValue) {
            if (newValue == null) {
                // a null value is allowed for the selectedIndex property, but it cannot be used to set the property
                // as it means several items are selected and we do not know which ones
                // just ignore the null value
                return;
            }
            var items = this._data.items;
            if (newValue < 0 || newValue >= items.length) {
                // unselect all values in case newValue is -1 or invalid
                this.setSelectedValues([]);
            } else {
                this.setSelectedValues([items[newValue].value]);
            }
        }
function (newValue) {
            if (newValue == null) {
                // a null value is allowed for the selectedIndex property, but it cannot be used to set the property
                // as it means several items are selected and we do not know which ones
                // just ignore the null value
                return;
            }
            var items = this._data.items;
            if (newValue < 0 || newValue >= items.length) {
                // unselect all values in case newValue is -1 or invalid
                this.setSelectedValues([]);
            } else {
                this.setSelectedValues([items[newValue].value]);
            }
        }
function ( newValue ) { if ( newValue == null ) { // a null value is allowed for the selectedIndex property, but it cannot be used to set the property // as it means several items are selected and we do not know which ones // just ignore the null value return ; } var items = this . _data . items ; if ( newValue < 0 || newValue >= items . length ) { // unselect all values in case newValue is -1 or invalid this . setSelectedValues ( [ ] ) ; } else { this . setSelectedValues ( [ items [ newValue ] . value ] ) ; } }
Set the selected index.
@param {Number} newValue
Set the selected index .