public class UICommand extends UIComponentBase implements ActionSource2
| Type | Phases | Description |
|---|---|---|
javax.faces.event.ActionEvent |
Invoke Application Apply Request Values |
Event delivered when the "action" of the component has been invoked; for example, by clicking on a button. The action may result in page navigation. |
| Modifier and Type | Field and Description |
|---|---|
static String |
COMPONENT_FAMILY |
static String |
COMPONENT_TYPE |
bindings| Constructor and Description |
|---|
UICommand()
Construct an instance of the UICommand.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addActionListener(ActionListener listener)
Adds a action listener.
|
void |
broadcast(FacesEvent event)
Invoke any listeners attached to this object which are listening
for an event whose type matches the specified event's runtime
type.
|
MethodBinding |
getAction()
Deprecated.
Use getActionExpression() instead.
|
javax.el.MethodExpression |
getActionExpression()
Gets Specifies the action to take when this command is invoked.
|
MethodBinding |
getActionListener()
Deprecated.
|
ActionListener[] |
getActionListeners()
Returns an array of attached action listeners.
|
String |
getFamily() |
Object |
getValue()
Gets The initial value of this component.
|
boolean |
isImmediate()
Gets A boolean value that identifies the phase during which action events
should fire.
|
void |
queueEvent(FacesEvent event) |
void |
removeActionListener(ActionListener listener)
Removes a action listener.
|
void |
restoreState(FacesContext facesContext,
Object state)
Invoked in the "restore view" phase, this initialises this
object's members from the values saved previously into the
provided state object.
|
Object |
saveState(FacesContext facesContext)
Invoked after the render phase has completed, this method
returns an object which can be passed to the restoreState
of some other instance of UIComponentBase to reset that
object's state to the same values as this object currently
has.
|
void |
setAction(MethodBinding action)
Deprecated.
Use setActionExpression instead.
|
void |
setActionExpression(javax.el.MethodExpression actionExpression)
Sets Specifies the action to take when this command is invoked.
|
void |
setActionListener(MethodBinding actionListener)
Deprecated.
|
void |
setImmediate(boolean immediate)
Sets A boolean value that identifies the phase during which action events
should fire.
|
void |
setValue(Object value)
Sets The initial value of this component.
|
addFacesListener, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBindingencodeAll, getContainerClientId, getValueExpression, setValueExpressionpublic static final String COMPONENT_FAMILY
public static final String COMPONENT_TYPE
public void setAction(MethodBinding action)
setAction in interface ActionSourcepublic MethodBinding getAction()
getAction in interface ActionSourcepublic void broadcast(FacesEvent event) throws AbortProcessingException
UIComponentBaseThis method does not propagate the event up to parent components, ie listeners attached to parent components don't automatically get called.
If any of the listeners throws AbortProcessingException then that exception will prevent any further listener callbacks from occurring, and the exception propagates out of this method without alteration.
ActionEvent events are typically queued by the renderer associated with this component in its decode method; ValueChangeEvent events by the component's validate method. In either case the event's source property references a component. At some later time the UIViewRoot component iterates over its queued events and invokes the broadcast method on each event's source object.
broadcast in class UIComponentBaseevent - must not be null.AbortProcessingExceptionpublic void queueEvent(FacesEvent event)
queueEvent in class UIComponentBasepublic boolean isImmediate()
isImmediate in interface ActionSourcepublic void setImmediate(boolean immediate)
setImmediate in interface ActionSourceimmediate - the new immediate valuepublic Object getValue()
public void setValue(Object value)
value - the new value valuepublic javax.el.MethodExpression getActionExpression()
getActionExpression in interface ActionSource2public void setActionExpression(javax.el.MethodExpression actionExpression)
setActionExpression in interface ActionSource2actionExpression - the new actionExpression valuepublic MethodBinding getActionListener()
getActionListener in interface ActionSourcepublic void setActionListener(MethodBinding actionListener)
setActionListener in interface ActionSourceactionListener - the new actionListener valuepublic void addActionListener(ActionListener listener)
addActionListener in interface ActionSourcelistener - the action listener to addpublic void removeActionListener(ActionListener listener)
removeActionListener in interface ActionSourcelistener - the action listener to removepublic ActionListener[] getActionListeners()
getActionListeners in interface ActionSourcepublic Object saveState(FacesContext facesContext)
UIComponentBasesaveState in interface StateHoldersaveState in class UIComponentBasepublic void restoreState(FacesContext facesContext, Object state)
UIComponentBaserestoreState in interface StateHolderrestoreState in class UIComponentBasestate - is an object previously returned by
the saveState method of this class.public String getFamily()
getFamily in class UIComponentCopyright © 2013 Apache Software Foundation. All Rights Reserved.