| |||||||
FRAMES NO FRAMES |
JSF provides three scopes for managed beans and therefore all the model objects that the managed beans reference: request, session, application. However a common requirement is a way for a model object to have a scope that is tied to the duration of the current view; that is longer than the request scope but shorter than session scope.
This component simply holds a reference to an arbitrary object (specified by the value property). Because this object is an ordinary component whose scope is the current view, the reference to the model automatically has that same scope.
When the value is an EL expression, then after the view is restored the recreated target object is stored at the specified location.
The object being saved must either:
Note that the saved object can be "chained" from view to view in order to extend its lifetime from a single view to a sequence of views if desired. A UISaveState component with an EL expression such as "#{someBean}" will save the object state after render, and restore it on postback. If navigation occurs to some other view and that view has a UISaveState component with the same EL expression then the object will simply be saved into the new view, thus extending its lifetime.
Tag Information | |
Tag Class | org.apache.myfaces.custom.savestate.SaveStateTag |
TagExtraInfo Class | None |
Body Content | empty |
Display Name | None |
Attributes | ||||
Name | Required | Request-time | Type | Description |
value | true | false | java.lang.String | The value of this parameter. |
id | false | false | java.lang.String | An identifier for this particular component instance within
a component view.
The id must be unique within the scope of the tag's enclosing NamingContainer (eg h:form or f:subview). The id is not necessarily unique across all components in the current view This value must be a static value, ie not change over the lifetime of a component. It cannot be defined via an EL expression; only a string is permitted. |
binding | false | false | java.lang.String | Identifies a backing bean property (of type UIComponent or appropriate subclass) to bind to this component instance. This value must be an EL expression. |
Variables | No Variables Defined. |
| |||||||
FRAMES NO FRAMES |