Class Hierarchy All Classes All Fields and Methods
Class javax.faces.component.UICommand
java.lang.Object javax.faces.component.UIComponent javax.faces.component.UIComponentBase javax.faces.component.UICommandpublic class UICommand
implements ActionSource
extends UIComponentBase
UICommand is a UIComponent that represents a user interface component which, when activated by the user, triggers an application specific "command" or "action". Such a component is typically rendered as a push button, a menu item, or a hyperlink.
When the decode() method of this UICommand, or its corresponding Renderer, detects that this control has been activated, it will queue an ActionEvent. Later on, the broadcast() method will ensure that this event is broadcast to all interested listeners.
Listeners will be invoked in the following order:
- ActionListeners, in the order in which they were registered.
- The "actionListener" MethodBinding
- The default ActionListener, retrieved from the Application - and therefore, any attached "action" MethodBinding.
By default, the rendererType property must be set to "javax.faces.Button". This value can be changed by calling the setRendererType() method.
Field Index Field Description COMPONENT_FAMILY The standard component family for this component. COMPONENT_TYPE The standard component type for this component.
Constructor Index Constructor Description UICommand() Create a new UICommand instance with default property values.
Method Index Method Description void addActionListener(ActionListener) void broadcast(FacesEvent) In addition to to the default broadcast processing, pass the ActionEvent being broadcast to the method referenced by actionListener (if any), and to the default ActionListener registered on the Application. MethodBinding getAction() MethodBinding getActionListener() ActionListener[] getActionListeners() String getFamily() Object getValue() Returns the value property of the UICommand. boolean isImmediate() void queueEvent(FacesEvent) Intercept queueEvent and, for ActionEvents, mark the phaseId for the event to be PhaseId.APPLY_REQUEST_VALUES if the immediate flag is true, PhaseId.INVOKE_APPLICATION otherwise. void removeActionListener(ActionListener) void restoreState(FacesContext, Object) Object saveState(FacesContext) void setAction(MethodBinding) void setActionListener(MethodBinding) void setImmediate(boolean) void setValue(Object) Sets the value property of the UICommand.
Fields
COMPONENT_FAMILY
public static final java.lang.String COMPONENT_FAMILY
The standard component family for this component.
COMPONENT_TYPE
public static final java.lang.String COMPONENT_TYPE
The standard component type for this component.
Constructors
UICommand
public UICommand()
Create a new UICommand instance with default property values.
Methods
addActionListener
public void addActionListener(ActionListener listener)
- Throws
- NullPointerException {@inheritDoc}
broadcast
public void broadcast(FacesEvent event) throws AbortProcessingException
In addition to to the default broadcast processing, pass the ActionEvent being broadcast to the method referenced by actionListener (if any), and to the default ActionListener registered on the Application.
- Parameters
- event - FacesEvent to be broadcast
- Throws
- AbortProcessingException Signal the JavaServer Faces implementation that no further processing on the current event should be performed
- Throws
- IllegalArgumentException if the implementation class of this FacesEvent is not supported by this component
- Throws
- NullPointerException if event is null
- Overrides
- broadcast in class UIComponentBase
getAction
public MethodBinding getAction()
getActionListener
public MethodBinding getActionListener()
getActionListeners
public ActionListener[] getActionListeners()
getFamily
public String getFamily()
getValue
public Object getValue()
Returns the value property of the UICommand. This is most often rendered as a label.
isImmediate
public boolean isImmediate()
queueEvent
public void queueEvent(FacesEvent e)
Intercept queueEvent and, for ActionEvents, mark the phaseId for the event to be PhaseId.APPLY_REQUEST_VALUES if the immediate flag is true, PhaseId.INVOKE_APPLICATION otherwise.
removeActionListener
public void removeActionListener(ActionListener listener)
- Throws
- NullPointerException {@inheritDoc}
restoreState
public void restoreState(FacesContext context, Object state)
saveState
public Object saveState(FacesContext context)
setAction
public void setAction(MethodBinding action)
setActionListener
public void setActionListener(MethodBinding actionListener)
setImmediate
public void setImmediate(boolean immediate)
setValue
public void setValue(Object value)
Sets the value property of the UICommand. This is most often rendered as a label.
- Parameters
- value - the new value
Class Hierarchy All Classes All Fields and Methods