src/aria/widgets/form/list/ListController.js
function (itemIndex, alreadyChanged) {

            var data = this._data;

            itemIndex = parseInt(itemIndex, 10); // it will most likely be a string before the conversion
            if (isNaN(itemIndex) || itemIndex < 0 || itemIndex > data.items.length) {
                return; // ignore wrong values of itemIndex
            }

            var newIndex;
            if (data.itemsView) {
                newIndex = this._data.itemsView.getNewIndex(data.itemsView.items, itemIndex);
            } else {
                newIndex = itemIndex;
            }
            this.setFocusedIndex(newIndex);

            if (alreadyChanged == null) {
                alreadyChanged = false;
            }
            var item = data.items[itemIndex];

            var evt = {
                name : "itemClick",
                index : itemIndex,
                item : item,
                value : item.value,
                alreadyChanged : alreadyChanged
            };
            this.$raiseEvent(evt);

            // Warning: this._data below shouldn't be changed to a local variable as this._data can be disposed in
            // some cases and it's needed in toggleSection
            if (this._data && !evt.cancelDefault && !alreadyChanged) {
                // we check this._data because because in the click event, the list controller
                // may have been disposed (e.g. in the selectBox)
                this.toggleSelection(itemIndex);
            }
        }
function (itemIndex, alreadyChanged) {

            var data = this._data;

            itemIndex = parseInt(itemIndex, 10); // it will most likely be a string before the conversion
            if (isNaN(itemIndex) || itemIndex < 0 || itemIndex > data.items.length) {
                return; // ignore wrong values of itemIndex
            }

            var newIndex;
            if (data.itemsView) {
                newIndex = this._data.itemsView.getNewIndex(data.itemsView.items, itemIndex);
            } else {
                newIndex = itemIndex;
            }
            this.setFocusedIndex(newIndex);

            if (alreadyChanged == null) {
                alreadyChanged = false;
            }
            var item = data.items[itemIndex];

            var evt = {
                name : "itemClick",
                index : itemIndex,
                item : item,
                value : item.value,
                alreadyChanged : alreadyChanged
            };
            this.$raiseEvent(evt);

            // Warning: this._data below shouldn't be changed to a local variable as this._data can be disposed in
            // some cases and it's needed in toggleSection
            if (this._data && !evt.cancelDefault && !alreadyChanged) {
                // we check this._data because because in the click event, the list controller
                // may have been disposed (e.g. in the selectBox)
                this.toggleSelection(itemIndex);
            }
        }
function ( itemIndex , alreadyChanged ) { var data = this . _data ; itemIndex = parseInt ( itemIndex , 10 ) ; // it will most likely be a string before the conversion if ( isNaN ( itemIndex ) || itemIndex < 0 || itemIndex > data . items . length ) { return ; // ignore wrong values of itemIndex } var newIndex ; if ( data . itemsView ) { newIndex = this . _data . itemsView . getNewIndex ( data . itemsView . items , itemIndex ) ; } else { newIndex = itemIndex ; } this . setFocusedIndex ( newIndex ) ; if ( alreadyChanged == null ) { alreadyChanged = false ; } var item = data . items [ itemIndex ] ; var evt = { name : "itemClick" , index : itemIndex , item : item , value : item . value , alreadyChanged : alreadyChanged } ; this . $raiseEvent ( evt ) ; // Warning: this._data below shouldn't be changed to a local variable as this._data can be disposed in // some cases and it's needed in toggleSection if ( this . _data && ! evt . cancelDefault && ! alreadyChanged ) { // we check this._data because because in the click event, the list controller // may have been disposed (e.g. in the selectBox) this . toggleSelection ( itemIndex ) ; } }
Called when an item is clicked
@param {String} itemIndex index of the item that was changed
@param {Boolean} alreadyChanged if true the selected property of the item was already changed (so that it is
not necessary to change it again, only raise the itemClick event)
Called when an item is clicked