Adds or remove items from the display value. If I am adding an item I also check that it wasn't already added
previously so there will be no duplicate items displayed.
@param {Array} selectedValues
@return {String}
331270
function (selectedValues) {
            var toDisplay = this._fieldDisplay, options = this._dataModel.listContent;
            var backUp = (this._fieldDisplay == 'value') ? 'label' : 'value';

            var display = [], option;
            for (var i = 0, l = selectedValues.length; i < l; i++) {
                option = selectedValues[i];
                for (var j = 0, l2 = options.length; j < l2; j++) {
                    if (options[j].value == option) {
                        display.push(options[j][toDisplay] ? options[j][toDisplay] : options[j][backUp]);
                    }
                }

            }
            return display.join(this._separator);
        }
1153827
function getSelectedValue(customSelect) {
    var hiddenSelect = this.UI.getHiddenSelect(customSelect);
    if (this.isMultiple(customSelect)) {
      var selectedOptions = [];
      [].forEach.call(hiddenSelect.options, function (option) {
        if (option.selected) {
          selectedOptions.push(option.value);
        }
      });
      return selectedOptions;
    } else {
      return hiddenSelect.options[hiddenSelect.selectedIndex].value;
    }
  }
1247094
function (items) {
                var itemsLength = items.length;
                for (var i = 0; i < itemsLength; i++) {
                    json.removeListener(items[i], "filteredIn", this._jsonChangeCallback);
                }
            }
257142
function(value) {
      // if trying to set wrong value (or ""), reset
      if (!lang.isArray(value)) {
         value = [];
      }
      
      var oldNb = this.ul.childNodes.length;
      var newNb = value.length;
      
      for(var i = 0 ; i < newNb ; i++) {
         if(i < oldNb) {
            this.updateItem(i, value[i]);
         }
         else {
            this.addItem(value[i]);
         }
      }
      
      // remove extra li items if any
      for(var j = newNb; j < oldNb; j++) {
         this._removeItem(newNb); // newNb is always the index of first li to remove (not j !)
      }
   }
1073013
function() {
          if(angular.isArray(selectedItemsList)) {
            var ixSmItem = selectedItemsList.indexOf(smItem);
            if(smItem[selectedAttribute]) {
              if(-1 === ixSmItem) {
                selectedItemsList.push(smItem);
              }
            } else {
              if(-1 < ixSmItem) {
                selectedItemsList.splice(ixSmItem, 1);
              }
            }
          }
        }
1090556
function ( fields ) {

            var field, data = {}, key, value;

            for ( var i = fields.length - 1; i >= 0; i-- ) {

                field = fields[ i ];

                field.removeAttribute( 'name' );
                key = field.getAttribute( this.fieldNameAttribute );
                value = field.value;

                // Cater for select boxes
                if ( field.options && typeof field.selectedIndex !== "undefined" ) {
                    value = field.options[ field.selectedIndex ].value;
                }

                data[ key ] = value;

            }
            
            return data;

        }
1255849
function ItemEventsHandler_toggleItemSelection(itemIndex) {
                    var site = this._site,
                        selection = site.selection,
                        selected = selection._isIncluded(itemIndex);

                    if (site.selectionMode === _UI.SelectionMode.single) {
                        if (!selected) {
                            selection.set(itemIndex);
                        } else {
                            selection.clear();
                        }
                    } else {
                        if (!selected) {
                            selection.add(itemIndex);
                        } else {
                            selection.remove(itemIndex);
                        }
                    }
                }
93966
public function selected($values)
    {
        if (is_array($values) || $values instanceof Closure) {
            $this->selected = $values;
        }
        else if (func_num_args() > 1) {
            $this->selected = func_get_args();
        } else {
            $this->selected = [$values];
        }

        return $this;
    }
1109354
function(deselectValues) {
            if(!$.isArray(deselectValues)) {
                deselectValues = [deselectValues];
            }

            for (var i = 0; i < deselectValues.length; i++) {

                var value = deselectValues[i];

                var $option = this.getOptionByValue(value);
                var $checkbox = this.getInputByValue(value);

                if($option === void(0) || $checkbox === void(0))
                {
                  continue;
                }

                if (this.options.selectedClass) {
                    $checkbox.parents('li')
                        .removeClass(this.options.selectedClass);
                }

                $checkbox.prop('checked', false);
                $option.prop('selected', false);
            }

            this.updateButtonText();
        }
1351070
function ListView_setAriaSelected(itemElement, isSelected) {
                    var ariaSelected = (itemElement.getAttribute("aria-selected") === "true");

                    if (isSelected !== ariaSelected) {
                        itemElement.setAttribute("aria-selected", isSelected);
                    }
                }
1165948
function () {
            var selected = [];
            var items = this._data.items;
            for (var i = 0; i < items.length; i++) {
                if (!items[i].initiallyDisabled) {
                    selected.push(items[i].value);
                }
            }
            this.setSelectedValues(selected);
            if (this._data) {
                this.json.setValue(this._data, "focusIndex", 0);
            }
        }
46433
def selected_items
      ((m = marked_items).any? ? m : Array(current_item)).reject {|i| %w(. ..).include? i.name}
    end
1064447
public void onItemSelected() {

        // Reset the current filter (if any)
        DataColumn firstColumn = dataSet.getColumnByIndex(0);
        String firstColumnId = firstColumn.getId();
        List<Integer> currentFilter = filterIndexes(firstColumnId);
        if (currentFilter != null && !currentFilter.isEmpty()) {
            filterReset();
        }

        ColumnSettings columnSettings = displayerSettings.getColumnSettings(firstColumn);
        String firstColumnName = columnSettings.getColumnName();
        String selected = view.getSelectedId();
        if (selected != null) {
            // Filter by the selected value (if any)
            filterUpdate(firstColumnId, Integer.parseInt(selected));
            view.showResetHint(firstColumnName);
        } else {
            view.showSelectHint(firstColumnName);
        }
    }
600094
protected void doNotifyListenersOfChangedValues(Map<K, R> oldValues, Map<K, R> newValues) {
        List<MapValueChangeListener<K, R>> listenersCopy = new ArrayList<MapValueChangeListener<K, R>>(listeners);
        Map<K, R> oldUnmodifiable = Collections.unmodifiableMap(oldValues);
        Map<K, R> newUnmodifiable = Collections.unmodifiableMap(newValues);
        for (MapValueChangeListener<K, R> listener : listenersCopy) {
            listener.valuesChanged(this, oldUnmodifiable, newUnmodifiable);
        }
    }
972320
private void changeValueIfNotMultiSelect(Object itemId) {

        @SuppressWarnings("unchecked")
        Set<String> value = (Set<String>)getValue();
        if (value == null) {
            select(itemId);
        } else if (!value.contains(itemId)) {
            setValue(null);
            select(itemId);
        }
    }
134776
public void shuffleSelectedLeftRowsToRightTableModel(final int[] selectedRows)
	{
		final int lastIndex = selectedRows.length - 1;
		for (int i = lastIndex; -1 < i; i--)
		{
			final int selectedRow = selectedRows[i];
			final T row = leftTableModel.removeAt(selectedRow);
			rightTableModel.add(row);
		}
	}
857446
private List<Serializable> getSelectedValues(List<IdName> values, List<Serializable> defaultValues) {
        List<Serializable> selectedValues = new ArrayList<Serializable>();
        if (defaultValues == null) {
            return selectedValues;
        }
        for (Serializable s : defaultValues) {
            for  (IdName in : values) {
                if (s instanceof IdName) {
                    if ((in.getId() != null) && in.getId().equals( ((IdName)s).getId())) {
                        selectedValues.add(in);
                        break;
                    }
                } else if ((in.getId() != null) && in.getId().equals(s)) {
                    selectedValues.add(in);
                    break;
                }
            }
        }
        
        return selectedValues;
    }