Skip navigation links
org.apache.myfaces.trinidad.model
Class RowKeyPropertyModel
java.lang.Object
javax.faces.model.DataModel
org.apache.myfaces.trinidad.model.CollectionModel
org.apache.myfaces.trinidad.model.SortableModel
org.apache.myfaces.trinidad.model.RowKeyPropertyModel
- All Implemented Interfaces:
- Iterable, LocalRowKeyIndex, RowKeyIndex
-
public class RowKeyPropertyModel
- extends SortableModel
Creates a CollectionModel whose row keys are defined by a unique data property in the model.
| Methods inherited from class org.apache.myfaces.trinidad.model.SortableModel |
addDataModelListener, getComparator, getDataModelListeners, getRowCount, getRowData, getRowIndex, getSortCriteria, getWrappedData, isRowAvailable, isSortable, removeDataModelListener, setCollator, setComparator, setRowIndex, setSortCriteria, setWrappedData, toString |
| Methods inherited from class org.apache.myfaces.trinidad.model.CollectionModel |
addRowKeyChangeListener, areRowsAvailable, areRowsAvailable, areRowsAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, clearCachedRow, clearCachedRow, clearCachedRows, clearCachedRows, clearLocalCache, ensureRowsAvailable, fireRowKeyChange, getCachingStrategy, getEstimatedRowCount, getEstimatedRowCountConfidence, getRowData, getRowData, getRowLimit, isRowAvailable, isRowAvailable, isRowLocallyAvailable, isRowLocallyAvailable, removeRowKeyChangeListener |
| Methods inherited from class javax.faces.model.DataModel |
iterator |
RowKeyPropertyModel
public RowKeyPropertyModel(Object model,
String rowKeyProperty)
- Creates a RowKeyPropertyModel.
- Parameters:
model - The underlying model. If necessary, this will be converted into a DataModel
rowKeyProperty - The property by which the row key can be accessed. Row key value must be unique
RowKeyPropertyModel
public RowKeyPropertyModel()
- No arg constructor for use as a managed-bean. Must call
SortableModel.setWrappedData(java.lang.Object) and setRowKeyProperty(java.lang.String) before using this instance.
getRowKey
public Object getRowKey()
- Gets the row key for the current row
-
- Specified by:
getRowKey in interface RowKeyIndex
- Overrides:
getRowKey in class SortableModel
-
- Returns:
- row key or null if model is not on any row
- See Also:
CollectionModel.setRowKey(java.lang.Object)
setRowKey
public void setRowKey(Object key)
- Moves the model to the row identified by the key.
-
- Specified by:
setRowKey in interface RowKeyIndex
- Overrides:
setRowKey in class SortableModel
-
- Parameters:
key - target row key
getRowKeyProperty
public String getRowKeyProperty()
- Gets the row key property name for this model
-
- Returns:
- row key property name
setRowKeyProperty
public void setRowKeyProperty(String rowKeyProperty)
- Sets the row key property for this model
-
- Parameters:
rowKeyProperty - row key property to set
getRowKey
protected Object getRowKey(Object row)
- gets the row key for the given row by resolving the _rowKeyProperty
-
- Parameters:
row - row to retrieve the row key for
- Returns:
- row key value
Skip navigation links
Copyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.