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:
- LocalRowKeyIndex, RowKeyIndex
-
public class RowKeyPropertyModel
- extends SortableModel
Creates a CollectionModel whose row keys are defined by a unique data property in the model.
| Constructor Summary |
RowKeyPropertyModel()
No arg constructor for use as a managed-bean. |
RowKeyPropertyModel(java.lang.Object model, java.lang.String rowKeyProperty)
Creates a RowKeyPropertyModel. |
| Method Summary |
java.lang.Object |
getRowKey()
Gets the row key for the current row |
protected java.lang.Object |
getRowKey(java.lang.Object row)
gets the row key for the given row by resolving the _rowKeyProperty |
java.lang.String |
getRowKeyProperty()
Gets the row key property name for this model |
void |
setRowKey(java.lang.Object key)
Moves the model to the row identified by the key. |
void |
setRowKeyProperty(java.lang.String rowKeyProperty)
Sets the row key property for this model |
| Methods inherited from class org.apache.myfaces.trinidad.model.SortableModel |
addDataModelListener, getDataModelListeners, getRowCount, getRowData, getRowIndex, getSortCriteria, getWrappedData, isRowAvailable, isSortable, removeDataModelListener, setRowIndex, setSortCriteria, setWrappedData, toString |
| Methods inherited from class org.apache.myfaces.trinidad.model.CollectionModel |
areRowsLocallyAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, clearCachedRow, clearCachedRow, clearCachedRows, clearCachedRows, clearLocalCache, ensureRowsAvailable, getCachingStrategy, getEstimatedRowCount, getEstimatedRowCountConfidence, getRowData, getRowData, isRowAvailable, isRowLocallyAvailable, isRowLocallyAvailable |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
RowKeyPropertyModel
public RowKeyPropertyModel(java.lang.Object model,
java.lang.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 java.lang.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(java.lang.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 java.lang.String getRowKeyProperty()
- Gets the row key property name for this model
-
- Returns:
- row key property name
setRowKeyProperty
public void setRowKeyProperty(java.lang.String rowKeyProperty)
- Sets the row key property for this model
-
- Parameters:
rowKeyProperty - row key property to set
getRowKey
protected java.lang.Object getRowKey(java.lang.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-2012 The Apache Software Foundation. All Rights Reserved.