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 jakarta. 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 ActionSource, any actions that one would normally take on a component that
implements ActionSource, such as UICommand, are valid for instances of this class. Instances of
this class participate in the regular Jakarta Faces 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 Jakarta Faces 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 7.4.2 "Default NavigationHandler Algorithm" of the Jakarta Faces Specification Document, for the
specification 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 static class | UIViewAction.
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.
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 jakarta.
Add a new |
| public void | broadcast(final FacesEvent
FacesEvent to be broadcastOverrides jakarta.
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 jakarta.
Override behavior from the superclass to queue an |
| private boolean | |
| public MethodExpression | getActionExpression()
Overrides default jakarta.
Return the |
| public ActionListener[] | getActionListeners()
Implements jakarta.
Return the set of registered |
| public String | getFamily()
Implements abstract jakarta. 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 jakarta.
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 request
Returns |
| public boolean | Returns: true if it should take the actions,
false otherwise.Overrides jakarta.
Returns the |
| public void | removeActionListener(final ActionListener
The listener)ActionListener to be removedImplements jakarta.
Remove an existing |
| public void | setActionExpression(final MethodExpression
the action expression. actionExpression)Overrides default jakarta.
Set the |
| public void | setImmediate(final boolean
The new immediate execution flag immediate)Implements jakarta.
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 jakarta.
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 jakarta. Doc from jakarta.
Add a new
| |
| broadcast | back to summary |
|---|---|
| public void broadcast(final FacesEvent event) throws AbortProcessingException Overrides jakarta.
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 jakarta.
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) | |
| getActionExpression | back to summary |
|---|---|
| public MethodExpression getActionExpression() Overrides default jakarta. Doc from jakarta.
Return the
The default implementation throws
| |
| getActionListeners | back to summary |
|---|---|
| public ActionListener[] getActionListeners() Implements jakarta. Doc from jakarta.
Return the set of registered
| |
| getFamily | back to summary |
|---|---|
| public String getFamily() Implements abstract jakarta. Doc from jakarta.
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 jakarta.
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 jakarta.
Returns the
| |
| removeActionListener | back to summary |
|---|---|
| public void removeActionListener(final ActionListener listener) Implements jakarta. Doc from jakarta.
Remove an existing
| |
| setActionExpression | back to summary |
|---|---|
| public void setActionExpression(final MethodExpression actionExpression) Overrides default jakarta. Doc from jakarta.
Set the
Any method referenced by such an expression must be public, with a return type of
The default implementation throws
| |
| setImmediate | back to summary |
|---|---|
| public void setImmediate(final boolean immediate) Implements jakarta. Doc from jakarta.
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 jakarta.
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 jakarta. Doc from jakarta.
The default behavior of this method is to call
| |
| isPostback | back to summary |
|---|---|
| public boolean isPostback() Overrides jakarta. Doc from jakarta.
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 jakarta. Doc from jakarta.
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 jakarta. Doc from jakarta.
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. Returns the name of this enum constant, as contained in the declaration. |
| 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. | |