21.11. Annotations for use with JSF dataTable

21.11. Annotations for use with JSF dataTable

The following annotations make it easy to implement clickable lists backed by a stateful session bean. They appear on attributes.

@DataModel
@DataModel("variableName")

Exposes an attribute of type List, Map, Set or Object[] as a JSF DataModel into the scope of the owning component (or the EVENT scope if the owning component is STATELESS). In the case of Map, each row of the DataModel is a Map.Entry.

  • value name of the conversation context variable. Default to the attribute name.

  • scope if scope=ScopeType.PAGE is explicitly specified, the DataModel will be kept in the PAGE context.

@DataModelSelection
@DataModelSelection

Injects the selected value from the JSF DataModel (this is the element of the underlying collection, or the map value).

  • value name of the conversation context variable. Not needed if there is exactly one @DataModel in the component.

@DataModelSelectionIndex
@DataModelSelectionIndex

Exposes the selection index of the JSF DataModel as an attribute of the component (this is the row number of the underlying collection, or the map key).

  • value name of the conversation context variable. Not needed if there is exactly one @DataModel in the component.