Posts Tagged ‘Data Model’

Implementing richfaces extended data model classes

May 19, 2008 7 comments

RichFaces data driven components (rich:dataTable , rich:dataGrid etc.) can be used in more complicated scenarios unlike standard DataTable and DataModel class. To get the new supports one needs to implement his own DataModel that extends one of ExtendedDataModel classes. But it’s not efficient every time implementing the class when needs. So here I write my own solution.


I extend org.ajax4jsf.model.SerializableDataModel class as usual. But the tricks lie in overridden walk method. A general fetch list of ExtendedFetchList is used to access data instead of a specific fetch list. ExtendedFetchList interface declares all the necessary methods for dynamic data accessing. See the following codes and usage example. Read more…