Perhaps the most obvious problem of DataTable and javax.faces.model.DataModel is lack of support for more complicated scenarios that use
data from the database.
To solve this problem Richfaces has two major tools:
The most important additional functions are:
A set of data-driven components that render data sets in various ways (rich:dataTable , rich:dataGrid, rich:dataList, a4j:repeat etc.).
All these components derive their common functionality from the common core that in addition to standard javax.faces.model.DataModel,
can understand and use
extended data model classes org.ajax4jsf.model.ExtendedDataModel and org.ajax4jsf.model.SerializableDataModel. These two classes work
together to provide functions that missing in the standard DataModel.
To use these extensions you need to implement your own DataModel that extends one of our ExtendedDataModel classes and implement some of
important functions. Below there is an example of such implementation.
- access for rows by primary keys instead of index position
- implementation of "visitor" pattern over the "range" of rows to support "table scroller" or "paginator" functions
- ability to serialize table data, so it can be used on post-back processing without additional database query
View AuctionDataModel.java Source