Home » Mojarra-2.0.1 » javax » faces » component » [javadoc | source]
public class: UICommand [javadoc | source]

All Implemented Interfaces:
    ActionSource2, PartialStateHolder, ComponentSystemEventListener, SystemEventListenerHolder

Direct Known Subclasses:
    HtmlCommandButton, HtmlCommandLink

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:

  1. ActionListener s, in the order in which they were registered.
  2. The "actionListener" MethodExpression (which will cover the "actionListener" that was set as a MethodBinding).
  3. The default ActionListener , retrieved from the Application - and therefore, any attached "action" MethodExpression .

By default, the rendererType property must be set to "javax.faces.Button". This value can be changed by calling the setRendererType() method.

Nested Class Summary:
enum class  UICommand.PropertyKeys  Properties that are tracked by state saving. 
Field Summary
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.

Fields inherited from javax.faces.component.UIComponent:
 public UICommand() 
Method from javax.faces.component.UICommand Summary:
addActionListener,   broadcast,   getAction,   getActionExpression,   getActionListener,   getActionListeners,   getFamily,   getValue,   isImmediate,   queueEvent,   removeActionListener,   setAction,   setActionExpression,   setActionListener,   setImmediate,   setValue
Methods from javax.faces.component.UIComponentBase:
addClientBehavior,   addFacesListener,   broadcast,   clearInitialState,   decode,   encodeBegin,   encodeChildren,   encodeEnd,   findComponent,   getAttributes,   getChildCount,   getChildren,   getClientBehaviors,   getClientId,   getDefaultEventName,   getDescriptorMap,   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 from javax.faces.component.UIComponent:
addFacesListener,   broadcast,   clearInitialState,   decode,   encodeAll,   encodeBegin,   encodeChildren,   encodeEnd,   findComponent,   getAttributes,   getChildCount,   getChildren,   getClientId,   getClientId,   getCompositeComponentParent,   getContainerClientId,   getCurrentComponent,   getCurrentCompositeComponent,   getFacesContext,   getFacesListeners,   getFacet,   getFacetCount,   getFacets,   getFacetsAndChildren,   getFamily,   getId,   getListenersForEventClass,   getNamingContainer,   getParent,   getRenderer,   getRendererType,   getRendersChildren,   getResourceBundleMap,   getStateHelper,   getStateHelper,   getValueBinding,   getValueExpression,   initialStateMarked,   invokeOnComponent,   isCompositeComponent,   isInView,   isRendered,   isVisitable,   markInitialState,   popComponentFromEL,   processDecodes,   processEvent,   processRestoreState,   processSaveState,   processUpdates,   processValidators,   pushComponentToEL,   queueEvent,   removeFacesListener,   setId,   setInView,   setParent,   setRendered,   setRendererType,   setValueBinding,   setValueExpression,   subscribeToEvent,   unsubscribeFromEvent,   visitTree
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.faces.component.UICommand Detail:
 public  void addActionListener(ActionListener listener) 
 public  void broadcast(FacesEvent event) throws AbortProcessingException 
 public MethodBinding getAction() 
Deprecated! This - has been replaced by #getActionExpression .

 public MethodExpression getActionExpression() 
 public MethodBinding getActionListener() 
Deprecated! Use - #getActionListeners instead.

 public ActionListener[] getActionListeners() 
 public String getFamily() 
 public Object getValue() 

    Returns the value property of the UICommand. This is most often rendered as a label.

 public boolean isImmediate() 

    The immediate flag.

 public  void queueEvent(FacesEvent e) 

    Intercept queueEvent and take the following action. If the event is an ActionEvent , obtain the UIComponent instance from the event. If the component is an ActionSource obtain the value of its "immediate" property. If it is true, mark the phaseId for the event to be PhaseId.APPLY_REQUEST_VALUES otherwise, mark the phaseId to be PhaseId.INVOKE_APPLICATION. The event must be passed on to super.queueEvent() before returning from this method.

 public  void removeActionListener(ActionListener listener) 
 public  void setAction(MethodBinding action) 
Deprecated! This - has been replaced by #setActionExpression(javax.el.MethodExpression) .

 public  void setActionExpression(MethodExpression actionExpression) 
 public  void setActionListener(MethodBinding actionListener) 
Deprecated! This - has been replaced by #addActionListener(javax.faces.event.ActionListener) .

 public  void setImmediate(boolean immediate) 
 public  void setValue(Object value) 

    Sets the value property of the UICommand. This is most often rendered as a label.