|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.faces.model.DataModel org.ajax4jsf.model.ExtendedDataModel org.richfaces.model.ScrollableTableDataModel<T>
public abstract class ScrollableTableDataModel<T>
Base class for data models
Subclasses must implement loadData(int, int, SortOrder)
For certain features (like selection and sorting) to work correctly together,
both getId(Object)
and getObjectById(Object)
methods need to be overriden
Nested Class Summary | |
---|---|
static class |
ScrollableTableDataModel.SimpleRowKey
Simple implementation - index-based row key |
Field Summary | |
---|---|
protected SortOrder |
lastSortOrder
|
Constructor Summary | |
---|---|
ScrollableTableDataModel()
|
Method Summary | |
---|---|
java.lang.Object |
getId(T o)
Implementations may override it to provide domain-specific searches Id should be serializable Default implementation returns null anyway
If you override this method, you need to override getObjectById(Object) as well |
T |
getObjectById(java.lang.Object id)
This method is the reverse of getId(Object)
If you override this method, you need to override getId(Object) as well |
java.lang.Object |
getRowData()
|
int |
getRowIndex()
Row indexes navigation is no longer supported |
java.lang.Object |
getRowKey()
|
boolean |
isRowAvailable()
Quite simple implementation - data will be cached, so the call will be cheap |
abstract java.util.List<T> |
loadData(int startRow,
int endRow,
SortOrder sortOrder)
Load range of data items from the source. |
void |
setRowIndex(int index)
Row indexes navigation is no longer supported |
void |
setRowKey(java.lang.Object key)
Instead of simple int for current state selection, this model can use any object for
select current data. |
void |
walk(javax.faces.context.FacesContext context,
DataVisitor visitor,
Range range,
java.lang.Object argument)
Load data range, and iterate over it |
Methods inherited from class org.ajax4jsf.model.ExtendedDataModel |
---|
getSerializableModel |
Methods inherited from class javax.faces.model.DataModel |
---|
addDataModelListener, getDataModelListeners, getRowCount, getWrappedData, removeDataModelListener, setWrappedData |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected SortOrder lastSortOrder
Constructor Detail |
---|
public ScrollableTableDataModel()
Method Detail |
---|
public abstract java.util.List<T> loadData(int startRow, int endRow, SortOrder sortOrder)
startRow
- endRow
- sortOrder
-
public void walk(javax.faces.context.FacesContext context, DataVisitor visitor, Range range, java.lang.Object argument) throws java.io.IOException
walk
in class ExtendedDataModel
context
- current JSF context.visitor
- instance of DataVisitor
, for process each row.range
- Implementation-specific range of data keys.argument
- Implementation-specific argument
java.io.IOException
public T getObjectById(java.lang.Object id)
getId(Object)
If you override this method, you need to override getId(Object)
as well
id
-
public java.lang.Object getId(T o)
null
anyway
If you override this method, you need to override getObjectById(Object)
as well
o
-
public java.lang.Object getRowData()
getRowData
in class javax.faces.model.DataModel
public int getRowIndex()
getRowIndex
in class javax.faces.model.DataModel
public boolean isRowAvailable()
isRowAvailable
in class javax.faces.model.DataModel
public void setRowIndex(int index)
setRowIndex
in class javax.faces.model.DataModel
public java.lang.Object getRowKey()
getRowKey
in class ExtendedDataModel
null
public void setRowKey(java.lang.Object key)
ExtendedDataModel
Instead of simple int
for current state selection, this model can use any object for
select current data. Implementation depend on model, with any restrictions :
Serializable
.Object.toString()
method must return representation compatible with UIComponent.getClientId(javax.faces.context.FacesContext)
,
as far as this string will be appended to clientId of iterator component.
setRowKey
in class ExtendedDataModel
key
- key for select current data, or null for clear selection.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |