UIViewAction represents a method invocation that occurs during the request processing lifecycle, usually in response to an initial request, as opposed to a postback.
The javax.faces.view.ViewDeclarationLanguage
implementation must cause an instance of this component to be placed
in the view for each occurrence of an <f:viewAction
/> element placed inside of an <f:metadata
/> element. The user must place <f:metadata
/> as a direct child of the UIViewRoot.
Because this class implements ActionSource2, any actions
that one would normally take on a component that implements
ActionSource2, such as UICommand, are valid for
instances of this class. Instances of this class participate in the
regular JSF lifecycle, including on Ajax requests.
The purpose of this component is to provide a light-weight front-controller solution for executing code upon the loading of a JSF view to support the integration of system services, content retrieval, view management, and navigation. This functionality is especially useful for non-faces (initial) requests.
The most common use case for this component is to take actions
necessary for a particular view, often with the help of one or more
UIViewParameters.
The NavigationHandler is consulted after the action is
invoked to carry out the navigation case that matches the action
signature and outcome. If a navigation case is matched that causes
the new viewId to be different from the current viewId, the runtime
must force a redirect to that matched navigation case with different
viewId, regardless of whether or not the matched navigation case with
different viewId called for a redirect. If the navigation will result in a flow
transition, the appropriate metadata must be included in the query
string for the redirect. See section JSF.7.4.2 Default
NavigationHandler Algorithm, for the discussion of how to
handle <redirect /> cases.
It's important to note that the full component tree is not built
before the UIViewAction components are processed on an non-faces
(initial) request. Rather, the component tree only contains the
ViewMetadata, an important part of the optimization of this
component and what sets it apart from a PreRenderViewEvent
listener.
| Modifier and Type | Class and Description |
|---|---|
| private class | UIViewAction.InstrumentedFacesContext
A FacesContext delegator that gives us the necessary controls over the FacesContext to allow the execution of the lifecycle to accomodate the UIViewAction sequence. |
| pack-priv static enum | UIViewAction.PropertyKeys
Properties that are tracked by state saving. |
| Modifier and Type | Field and Description |
|---|---|
| public static final String | COMPONENT_FAMILY
The standard component family for this component. |
| public static final String | COMPONENT_TYPE
The standard component type for this component. |
| private static final String | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addActionListener(final ActionListener
The listener)ActionListener to be addedImplements javax.
Add a new |
| public void | broadcast(final FacesEvent
FacesEvent to be broadcastOverrides javax. Enable the method invocation
specified by this component instance to return a value that
performs navigation, similar in spirit to |
| public void | decode(final FacesContext
FacesContext for the request we are processingOverrides javax. Override behavior from the
superclass to queue an |
| private boolean | |
| public MethodBinding | getAction()
Implements javax.
Deprecated
If the implementing class also implements |
| public MethodExpression | getActionExpression()
Implements javax.
Return the |
| public MethodBinding | getActionListener()
Implements javax.
Deprecated
If |
| public ActionListener[] | getActionListeners()
Implements javax.
Return the set of registered |
| public String | getFamily()
Implements abstract javax. Return the identifier of the component family to which this component belongs. |
| public String | Returns: the phase (as string).Returns the name of the lifecycle phase in which the action is to be queued. |
| private PhaseId | |
| private UIViewRoot | |
| private void | |
| public boolean | isImmediate()
Implements javax. If the value of the component's
|
| public boolean | Returns: true if operating upon postback, false otherwise.If |
| public static boolean | Returns: true is currently processing broadcast, false otherwise.FacesContext for the current requestReturns |
| public boolean | Returns: true if it should be rendered, false otherwise.Overrides javax. Return |
| public void | removeActionListener(final ActionListener
The listener)ActionListener to be removedImplements javax.
Remove an existing |
| public void | setAction(final MethodBinding
The new MethodBinding expression action)Implements javax.
Deprecated
If the implementing class also implements |
| public void | setActionExpression(final MethodExpression
the action expression. actionExpression)Implements javax.
Set the |
| public void | setActionListener(final MethodBinding
The new method binding expression actionListener)Implements javax.
Deprecated
Wrap the argument |
| public void | setImmediate(final boolean
The new immediate execution flag immediate)Implements javax.
Set the "immediate execution" flag for this |
| private void | |
| public void | setOnPostback(final boolean
the onPostback flag. onPostback)Controls whether or not this component operates on postback. |
| public void | setPhase(final String
the phase id (as string value). phase)Attempt to set the lifecycle phase
in which this instance will queue its |
| public void | setRendered(final boolean
the new value of the property. condition)Overrides javax. Sets the |
| COMPONENT_FAMILY | back to summary |
|---|---|
| public static final String COMPONENT_FAMILY The standard component family for this component. | |
| COMPONENT_TYPE | back to summary |
|---|---|
| public static final String COMPONENT_TYPE The standard component type for this component. | |
| UIVIEWACTION_BROADCAST | back to summary |
|---|---|
| private static final String UIVIEWACTION_BROADCAST | |
| UIVIEWACTION_EVENT_COUNT | back to summary |
|---|---|
| private static final String UIVIEWACTION_EVENT_COUNT | |
| UIViewAction | back to summary |
|---|---|
| public UIViewAction()
Create a new | |
| addActionListener | back to summary |
|---|---|
| public void addActionListener(final ActionListener listener) Implements javax. Doc from javax.
Add a new
| |
| broadcast | back to summary |
|---|---|
| public void broadcast(final FacesEvent event) throws AbortProcessingException Overrides javax. Enable the method invocation
specified by this component instance to return a value that
performs navigation, similar in spirit to Take no action and return immediately if any of the following conditions are true.
Save a local reference to the viewId of the current
Obtain the If the response has been marked as complete during the
invocation of
| |
| decode | back to summary |
|---|---|
| public void decode(final FacesContext context) Overrides javax. Override behavior from the
superclass to queue an Take no action if any of the following conditions are true:
Instantiate an
Queue the event with a call to
| |
| decrementEventCountAndReturnTrueIfZero | back to summary |
|---|---|
| private boolean decrementEventCountAndReturnTrueIfZero(FacesContext context) | |
| getAction | back to summary |
|---|---|
| public MethodBinding getAction() Implements javax. Doc from javax. Deprecated
If the implementing class also implements
If the implementing class does not implement
| |
| getActionExpression | back to summary |
|---|---|
| public MethodExpression getActionExpression() Implements javax. Doc from javax.
Return the
Note that it's possible that the returned
| |
| getActionListener | back to summary |
|---|---|
| public MethodBinding getActionListener() Implements javax. Doc from javax. Deprecated
If
The method to be invoked, if this
| |
| getActionListeners | back to summary |
|---|---|
| public ActionListener[] getActionListeners() Implements javax. Doc from javax.
Return the set of registered
| |
| getFamily | back to summary |
|---|---|
| public String getFamily() Implements abstract javax. Doc from javax.
Return the identifier of the component family to which this component belongs. This
identifier, in conjunction with the value of the | |
| getPhase | back to summary |
|---|---|
| public String getPhase() Returns the name of the lifecycle phase in which the action is to be queued.
| |
| getPhaseId | back to summary |
|---|---|
| private PhaseId getPhaseId() | |
| getViewRootOf | back to summary |
|---|---|
| private UIViewRoot getViewRootOf(final FacesEvent e) | |
| incrementEventCount | back to summary |
|---|---|
| private void incrementEventCount(FacesContext context) | |
| isImmediate | back to summary |
|---|---|
| public boolean isImmediate() Implements javax. If the value of the component's
| |
| isOnPostback | back to summary |
|---|---|
| public boolean isOnPostback() If
| |
| isProcessingBroadcast | back to summary |
|---|---|
| public static boolean isProcessingBroadcast(FacesContext context) Returns
| |
| isRendered | back to summary |
|---|---|
| public boolean isRendered() Overrides javax. Return
| |
| removeActionListener | back to summary |
|---|---|
| public void removeActionListener(final ActionListener listener) Implements javax. Doc from javax.
Remove an existing
| |
| setAction | back to summary |
|---|---|
| public void setAction(final MethodBinding action) Implements javax. Doc from javax. Deprecated
If the implementing class also implements
If the implementing class does not implement
Any method referenced by such an expression must be public, with a return type of
| |
| setActionExpression | back to summary |
|---|---|
| public void setActionExpression(final MethodExpression actionExpression) Implements javax. Doc from javax.
Set the
Any method referenced by such an expression must be public, with a return type of
| |
| setActionListener | back to summary |
|---|---|
| public void setActionListener(final MethodBinding actionListener) Implements javax. Doc from javax. Deprecated
Wrap the argument
Any method referenced by such an expression must be public, with a return type of
| |
| setImmediate | back to summary |
|---|---|
| public void setImmediate(final boolean immediate) Implements javax. Doc from javax.
Set the "immediate execution" flag for this
| |
| setIsProcessingUIViewActionBroadcast | back to summary |
|---|---|
| private void setIsProcessingUIViewActionBroadcast(FacesContext context, boolean value) | |
| setOnPostback | back to summary |
|---|---|
| public void setOnPostback(final boolean onPostback) Controls whether or not this component operates on postback.
| |
| setPhase | back to summary |
|---|---|
| public void setPhase(final String phase) Attempt to set the lifecycle phase
in which this instance will queue its If set, this value takes precedence over the immediate flag.
| |
| setRendered | back to summary |
|---|---|
| public void setRendered(final boolean condition) Overrides javax. Sets the
| |
| Modifier and Type | Field and Description |
|---|---|
| private Boolean | |
| private boolean | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| postback | back to summary |
|---|---|
| private Boolean postback | |
| renderedResponseControlDisabled | back to summary |
|---|---|
| private boolean renderedResponseControlDisabled | |
| viewRootCleared | back to summary |
|---|---|
| private boolean viewRootCleared | |
| InstrumentedFacesContext | back to summary |
|---|---|
| public InstrumentedFacesContext(final FacesContext wrapped) | |
| clearPostback | back to summary |
|---|---|
| public UIViewAction. | |
| clearViewRoot | back to summary |
|---|---|
| public UIViewAction. | |
| disableRenderResponseControl | back to summary |
|---|---|
| public UIViewAction. | |
| getViewRoot | back to summary |
|---|---|
| public UIViewRoot getViewRoot() Overrides javax. Doc from javax. The default behavior of this method is to
call
| |
| isPostback | back to summary |
|---|---|
| public boolean isPostback() Overrides javax. Doc from javax. The default behavior of this method is to
call
| |
| pushViewIntoRequestMap | back to summary |
|---|---|
| public UIViewAction. Make it look like we have dispatched a request using the include method. | |
| renderResponse | back to summary |
|---|---|
| public void renderResponse() Overrides javax. Doc from javax. The default behavior of this method is to
call
| |
| restore | back to summary |
|---|---|
| public void restore() | |
| set | back to summary |
|---|---|
| public void set() | |
| setViewRoot | back to summary |
|---|---|
| public void setViewRoot(final UIViewRoot viewRoot) Overrides javax. Doc from javax. The default behavior of this method is to
call
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final UIViewAction. | |
| public static final UIViewAction. | |
| private String | name
Hides java. |
| public static final UIViewAction. | |
| public static final UIViewAction. | |
| public static final UIViewAction. |
| Access | Constructor and Description |
|---|---|
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public String | toString()
Overrides java. |
| public static UIViewAction. | |
| public static UIViewAction. |
| actionExpression | back to summary |
|---|---|
| public static final UIViewAction. | |
| immediate | back to summary |
|---|---|
| public static final UIViewAction. | |
| name | back to summary |
|---|---|
| private String name Hides java. | |
| onPostback | back to summary |
|---|---|
| public static final UIViewAction. | |
| phase | back to summary |
|---|---|
| public static final UIViewAction. | |
| renderedAttr | back to summary |
|---|---|
| public static final UIViewAction. | |
| PropertyKeys | back to summary |
|---|---|
| private PropertyKeys() | |
| PropertyKeys | back to summary |
|---|---|
| private PropertyKeys(final String name) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns the name of this enum constant, as contained in the declaration. This method may be overridden, though it typically isn't necessary or desirable. An enum class should override this method when a more "programmer-friendly" string form exists. | |
| valueOf | back to summary |
|---|---|
| public static UIViewAction. | |
| values | back to summary |
|---|---|
| public static UIViewAction. | |