code: private void handleSelectionRequest(final Request request) {
  		String[] paramValue = request.getParameterValues(getId() + ".selected");
  
  		if (paramValue == null) {
  			paramValue = new String[0];
  		}
  
  		Map<List<Integer>, Object> pageRowKeys = getCurrentRowIndexAndKeys();
  
  		String[] selectedRows = removeEmptyStrings(paramValue);
  		Set<?> oldSelections = getSelectedRows();
  		Set<Object> newSelections;
  
  		boolean singleSelect = getSelectMode() == SelectMode.SINGLE;
  
  		if (getTableModel().getRowCount() == 0) {
  			newSelections = new HashSet<>();
  			selectedRows = new String[0];
  		} else if (getPaginationMode() == PaginationMode.NONE || getPaginationMode() == PaginationMode.CLIENT
  				|| oldSelections == null || !isPaginated()) {
  			newSelections = new HashSet<>(selectedRows.length);
  		} else if (singleSelect && selectedRows.length > 0) {
  			// For single-select, we need to remove the old entries
  			newSelections = new HashSet<>(1);
  		} else {
  			// For multi-select, we need the entries for the current page only
  			newSelections = (Set<Object>) new HashSet<>(oldSelections);
  			newSelections.removeAll(pageRowKeys.values());
  		}
  
  		for (String selectedRow : selectedRows) {
  			List<Integer> rowIndex = TableUtil.rowIndexStringToList(selectedRow);
  			Object key = pageRowKeys.get(rowIndex);
  			if (key == null) {
  				continue;
  			}
  			newSelections.add(key);
  			if (singleSelect) {
  				break;
  			}
  		}
  
  		setSelectedRows(newSelections);
  
  		// If there is a selection change action specified, it may need to be fired
  		Action selectionChangeAction = getSelectionChangeAction();
  
  		if (selectionChangeAction != null && !newSelections.equals(oldSelections)) {
  			selectionChangeAction.execute(new ActionEvent(this, SELECTION_ACTION_COMMAND));
  		}
  	}
docs: Handles a request containing row selection data.
  
  @param request the request containing row selection data.