Professional Documents
Culture Documents
JSF Tables
JSF Tables
JSF Tables
h:dataTable
<h:dataTable value=“#{store.categoryLarge.dogs}” var=„largeDog‟>
<h:column>
<h:outputText value=“#{largeDog.name}”/>
</h:column>
<h:column>
<h:outputText value=“#{largeDog.age}”/>
</h:column>
</h:dataTable>
Inheritance
javax.faces.model.ArrayDataModel javax.faces.model.ListDataModel
Composition
java.util.Array java.util.ArrayList
DELETING OR ADDING TABLE ROWS
setWrappedData();
ListDataModel
Inheritance
DataModel
<<Interface>>
LineItemSortFilterModelModelJSF
DECORATOR PATTERN MOTIVATION
DataModel
<<Interface>>
ViewFactoryJSF LineItemSortFilterModelJSF
ABSTRACT FACTORY PATTERN CONTINUED…
The factory determines the actual concrete type of object to be created, and
it is here that the object is actually created. However, the factory only
returns an abstract pointer to the created concrete object.
Insulates model from object creation by having the model ask a factory
object to create an object of the desired abstract type and to return an
abstract pointer to the object.
Model code does not know - and is not burdened by - the actual concrete
type of the object which was just created. However, the type of a concrete
object (and hence a concrete factory) has been known to the abstract
factory, for instance, factory can read it from a configuration file.
Model code has no knowledge whatsoever of the concrete type, Model
code accesses such objects only through their abstract interface.
Adding new concrete types is done by modifying the code to use a
different factory, a modification which is typically one line in one file.