From e764854339469910cfd0c28b4c27454fea2ad2e2 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Mon, 19 Jul 2010 09:26:04 +0000 Subject: [PATCH] SWF-1321 Document DataModel implementations. --- spring-webflow-reference/src/spring-faces.xml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/spring-webflow-reference/src/spring-faces.xml b/spring-webflow-reference/src/spring-faces.xml index af88d11a..85bddd63 100644 --- a/spring-webflow-reference/src/spring-faces.xml +++ b/spring-webflow-reference/src/spring-faces.xml @@ -353,9 +353,13 @@ ]]> + + + Data Model Implementations - The custom DataModel provides some extra conveniences such as being serializable for storage beyond - request scope and access to the currently selected row in EL expressions. For example, on postback from + In the example above result-type="dataModel" results in the wrapping of List<Booking> with custom DataModel type. + The custom DataModel provides extra conveniences such as being serializable for storage beyond + request scope as well as access to the currently selected row in EL expressions. For example, on postback from a view where the action event was fired by a component within a DataTable, you can take action on the selected row's model instance: @@ -364,6 +368,17 @@ ]]> + + Spring Web Flow provides two custom DataModel types: OneSelectionTrackingListDataModel and ManySelectionTrackingListDataModel. + As the names indicate they keep track of one or multiple selected rows. + This is done with the help of a SelectionTrackingActionListener listener, which responds to JSF action events and invokes the appopriate methods on the SelectinAware data models to record the currently clicked row. + + + To understand how this is configured, keep in mind the FacesConversionService registers a DataModelConverter against the alias "dataModel" on startup. + When result-type="dataModel" is used in a flow definition it causes the DataModelConverter to be used. + The converter then wraps the given List with an instance of OneSelectionTrackingListDataModel. + To use the ManySelectionTrackingListDataModel you will need to register your own custom converter. +