@Override
    public void setRowIndex(int rowIndex) {
        int oldIndex = this.rowIndex;

        if (rowIndex == -1) {
            this.rowIndex = -1;
        }
        else if (pageSize > 0) {
            this.rowIndex = (rowIndex % pageSize);
        }
        else {
            this.rowIndex = rowIndex;
        }

        if (data == null) {
            return;
        }

        DataModelListener[] listeners = getDataModelListeners();
        if (listeners != null && oldIndex != this.rowIndex) {
            Object rowData = null;
            if (isRowAvailable()) {
                rowData = getRowData();
            }

            DataModelEvent dataModelEvent = new DataModelEvent(this, rowIndex, rowData);
            for (int i = 0; i < listeners.length; i++) {
                listeners[i].rowSelected(dataModelEvent);
            }
        }
    }
Recalculates <code>first</code>, see #1921.
Also see: {@link org.primefaces.component.api.UIPageableData#calculateFirst()}

@param first the <code>first</code> param from the {@link #load(int, int, java.util.Map, java.util.Map)} method.
@param pageSize the <code>pageSize</code> param from the {@link #load(int, int, java.util.Map, java.util.Map)} method.
@param rowCount the new <code>rowCount</code>.
@return the recalculated <code>first</code>.
primefaces/src/main/java/org/primefaces/model/LazyDataModel.java