The portlet model's mechanism for switching views is based on a concept called
portlet Modes. A portlet has distinct Modes (View, Edit, Help). A portlet
typically renders a different view/from a different view context depending on a
mode. Within a given Mode a portlet can extend the model and manage a current
view from within a set of views (for that Mode).
I.e. rather then a typical JSF application having a single set of views that
compose the application, a JSF portlet application has N sets of views where N
is the number of modes supported by the portlet.
Typically when a portlet enters a Mode (from View Mode) they enter at the Modes
default view. However when they exit the Mode by returning to the prior Mode
they just as commonly want to return to the view that was current when they left
the mode as they want to return to that Mode's default view. The portlet
developer is responsible for encoding this navigation directly – though the
underlying environment typically supports navigating to the default view in the
situation that the portlet does nothing other than switch Modes.
The Portlet bridge wants to make it possible for a JSF application to encode
this information in a navigation (rule). It is considering doing the following:
retaining the lastViewId of a Mode being exited and making it available on a
request Attribute (e.g. the request attribute:
javax.portlet.faces.currentViewId.VIEW would have a value of the viewId of the
last view in the last view that was in the portlet VIEW mode. If you wanted the
last mode of the EDIT mode it would be accessed similarly:
By doing this one could now write the following EL to reference this view:
To make this useful however, the developer needs to be able to specify this in
the <to-view-id> element of their navigation rule. I.e. Because the portlet use
cases demands that the developer dynamically determine the navigation view when
it triggers/encodes a mode change we would like JSF to support expressing such
dynanism in its navigation rules. As JSF current doesn't specify that the
<to-view-id> element contains/evaluates an EL expression we are seeking this change.