src/aria/widgets/form/list/ListController.js
function (newValue) {

            var data = this._data;
            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 = data.items;

            if (newValue < 0) {
                return false;
            } else if (newValue >= items.length) {
                return false;
            } else {

                this.json.setValue(data, "focusIndex", newValue);
                this.setFocus(data.focusIndex);
                return true;

            }
        }
function (newValue) {

            var data = this._data;
            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 = data.items;

            if (newValue < 0) {
                return false;
            } else if (newValue >= items.length) {
                return false;
            } else {

                this.json.setValue(data, "focusIndex", newValue);
                this.setFocus(data.focusIndex);
                return true;

            }
        }
function ( newValue ) { var data = this . _data ; 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 = data . items ; if ( newValue < 0 ) { return false ; } else if ( newValue >= items . length ) { return false ; } else { this . json . setValue ( data , "focusIndex" , newValue ) ; this . setFocus ( data . focusIndex ) ; return true ; } }
This focuses the correct item in the list based on the item passed
@public
@param {Number} The item number to focus
@returns Boolean
This focuses the correct item in the list based on the item passed