|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.faces.component.UIComponent
javax.faces.component.UIComponentBase
org.jboss.seam.faces.component.UIViewAction
public class UIViewAction
UIViewAction is an ActionSource2 UIComponent
that specifies an application-specific command (or action)--defined as an EL
method expression--to be invoked during one of the JSF lifecycle phases that
proceeds view rendering. This component must be declared as a child of the
ViewMetadata facet of the UIViewRoot so that it gets
incorporated into the JSF lifecycle on both non-faces (initial) requests and
faces (postback) 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 UIViewAction component is closely tied to the
UIViewParameter component. The UIViewParameter component
binds a request parameter to a model property. Most of the time, this binding
is used to populate the model with data that supports the method being
invoked by a UIViewAction component, much like form inputs populate
the model with data to support the method being invoked by a
UICommand component.
When the UIViewAction is
invoked, it will queue an ActionEvent to be broadcast to all
interested listeners when the
If the value of the component's
The invocation of the action is normally suppressed (meaning the
ActionEvent is not queued) on a faces request. It can be enabled by
setting the component's
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, or the response is marked complete by the
action, subsequent UIViewAction components associated with the
current view are short-circuited. The lifecycle then advances appropriately.
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.
UIViewParameter| Field Summary | |
|---|---|
static String |
COMPONENT_FAMILY
The standard component family for this component. |
static String |
COMPONENT_TYPE
The standard component type for this component. |
| Fields inherited from class javax.faces.component.UIComponent |
|---|
BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, VIEW_LOCATION_KEY |
| Constructor Summary | |
|---|---|
UIViewAction()
Create a new UIViewAction instance with default property values. |
|
| Method Summary | |
|---|---|
void |
addActionListener(javax.faces.event.ActionListener listener)
Action listeners are not supported by the UIViewAction component. |
void |
broadcast(javax.faces.event.FacesEvent event)
In addition to to the default UIComponent.broadcast(javax.faces.event.FacesEvent) processing,
pass the ActionEvent being broadcast to the default
ActionListener registered on the
Application. |
void |
decode(javax.faces.context.FacesContext context)
First, determine if the action should be invoked by evaluating this components pre-conditions. |
javax.faces.el.MethodBinding |
getAction()
Deprecated. This has been replaced by getActionExpression(). |
javax.el.MethodExpression |
getActionExpression()
Returns the action, represented as an EL method expression, to invoke. |
javax.faces.el.MethodBinding |
getActionListener()
Action listeners are not supported by the UIViewAction component. |
javax.faces.event.ActionListener[] |
getActionListeners()
Action listeners are not supported by the UIViewAction component. |
String |
getFamily()
|
String |
getPhase()
Returns the name of the phase in which the action is to be queued. |
javax.faces.event.PhaseId |
getPhaseId()
|
boolean |
isIf()
Returns a condition, represented as an EL value expression, that must evaluate to true for the action to be invoked. |
boolean |
isImmediate()
Returns the value which dictates the JSF lifecycle phase in which the action is invoked. |
boolean |
isOnPostback()
Returns a boolean value that controls whether the action is invoked during faces (postback) request. |
void |
removeActionListener(javax.faces.event.ActionListener listener)
Action listeners are not supported by the UIViewAction component. |
void |
setAction(javax.faces.el.MethodBinding action)
Deprecated. This has been replaced by setActionExpression(javax.el.MethodExpression). |
void |
setActionExpression(javax.el.MethodExpression actionExpression)
Sets the action, represented as an EL method expression, to invoke. |
void |
setActionListener(javax.faces.el.MethodBinding actionListener)
Action listeners are not supported by the UIViewAction component. |
void |
setIf(boolean condition)
Sets the condition, represented as an EL value expression, that must evaluate to true for the action to be invoked. |
void |
setImmediate(boolean immediate)
Sets the immediate flag, which controls the JSF lifecycle in which the action is invoked. |
void |
setOnPostback(boolean onPostback)
Set the bookean flag that controls whether the action is invoked during a faces (postback) request. |
void |
setPhase(String phase)
Set the name of the phase in which the action is to be queued. |
| Methods inherited from class javax.faces.component.UIComponentBase |
|---|
addClientBehavior, addFacesListener, clearInitialState, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, markInitialState, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding |
| Methods inherited from class javax.faces.component.UIComponent |
|---|
encodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getListenersForEventClass, getNamingContainer, getResourceBundleMap, getStateHelper, getStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, setInView, setValueExpression, subscribeToEvent, unsubscribeFromEvent, visitTree |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String COMPONENT_TYPE
The standard component type for this component.
public static final String COMPONENT_FAMILY
The standard component family for this component.
| Constructor Detail |
|---|
public UIViewAction()
Create a new UIViewAction instance with default property values.
| Method Detail |
|---|
public String getFamily()
getFamily in class javax.faces.component.UIComponent@Deprecated public javax.faces.el.MethodBinding getAction()
getActionExpression().
getAction in interface javax.faces.component.ActionSource@Deprecated public void setAction(javax.faces.el.MethodBinding action)
setActionExpression(javax.el.MethodExpression).
setAction in interface javax.faces.component.ActionSourceUnsupportedOperationException - if calledpublic javax.faces.el.MethodBinding getActionListener()
UIViewAction component.
getActionListener in interface javax.faces.component.ActionSourceUnsupportedOperationException - if calledpublic void setActionListener(javax.faces.el.MethodBinding actionListener)
UIViewAction component.
setActionListener in interface javax.faces.component.ActionSourceUnsupportedOperationException - if calledpublic boolean isImmediate()
isImmediate in interface javax.faces.component.ActionSourcepublic void setImmediate(boolean immediate)
setImmediate in interface javax.faces.component.ActionSourcepublic String getPhase()
Returns the name of the phase in which the action is to be queued. Only the following phases are supported (case does not matter):
If the phase is set, it takes precedence over the immediate flag.
public void setPhase(String phase)
public javax.faces.event.PhaseId getPhaseId()
public void addActionListener(javax.faces.event.ActionListener listener)
UIViewAction component.
addActionListener in interface javax.faces.component.ActionSourceUnsupportedOperationException - if calledpublic javax.faces.event.ActionListener[] getActionListeners()
UIViewAction component.
getActionListeners in interface javax.faces.component.ActionSourcepublic void removeActionListener(javax.faces.event.ActionListener listener)
UIViewAction component.
removeActionListener in interface javax.faces.component.ActionSourceUnsupportedOperationException - if calledpublic javax.el.MethodExpression getActionExpression()
getActionExpression in interface javax.faces.component.ActionSource2public void setActionExpression(javax.el.MethodExpression actionExpression)
setActionExpression in interface javax.faces.component.ActionSource2public boolean isOnPostback()
public void setOnPostback(boolean onPostback)
public boolean isIf()
public void setIf(boolean condition)
public void broadcast(javax.faces.event.FacesEvent event)
throws javax.faces.event.AbortProcessingException
In addition to to the default UIComponent.broadcast(javax.faces.event.FacesEvent) processing,
pass the ActionEvent being broadcast to the default
ActionListener registered on the
Application.
broadcast in class javax.faces.component.UIComponentBaseevent - FacesEvent to be broadcast
javax.faces.event.AbortProcessingException - Signal the JavaServer Faces
implementation that no further processing on the current event
should be performed
IllegalArgumentException - if the implementation class of this
FacesEvent is not supported by this component
NullPointerException - if event is nullpublic void decode(javax.faces.context.FacesContext context)
ActionEvent.
Set the phaseId in which the queued ActionEvent should be
broadcast by assigning the appropriate value to the phaseId property of
the ActionEvent according to the evaluated value of the immediate
attribute. If the value is PhaseId.APPLY_REQUEST_VALUES. Otherwise, set the phaseId to to
PhaseId.INVOKE_APPLICATION.
Finally, queue the event by calling ActionEvent just created.
decode in class javax.faces.component.UIComponentBase
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||