Save This Page
Home » mojarra-1.2_09-b02-FCS-source » javax.faces.component » [javadoc | source]
javax.faces.component
public class: UICommand [javadoc | source]
java.lang.Object
   javax.faces.component.UIComponent
      javax.faces.component.UIComponentBase
         javax.faces.component.UICommand

All Implemented Interfaces:
    ActionSource2, StateHolder

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.

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:
attributesThatAreSet,  bindings
Constructor:
 public UICommand() 
Method from javax.faces.component.UICommand Summary:
addActionListener,   broadcast,   getAction,   getActionExpression,   getActionListener,   getActionListeners,   getFamily,   getValue,   isImmediate,   queueEvent,   removeActionListener,   restoreState,   saveState,   setAction,   setActionExpression,   setActionListener,   setImmediate,   setValue
Methods from javax.faces.component.UIComponentBase:
addFacesListener,   broadcast,   decode,   encodeBegin,   encodeChildren,   encodeEnd,   findComponent,   getAttributes,   getChildCount,   getChildren,   getClientId,   getDescriptorMap,   getFacesContext,   getFacesListeners,   getFacet,   getFacetCount,   getFacets,   getFacetsAndChildren,   getId,   getParent,   getRenderer,   getRendererType,   getRendersChildren,   getValueBinding,   invokeOnComponent,   isRendered,   isTransient,   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,   decode,   encodeAll,   encodeBegin,   encodeChildren,   encodeEnd,   findComponent,   getAttributes,   getAttributesThatAreSet,   getChildCount,   getChildren,   getClientId,   getContainerClientId,   getFacesContext,   getFacesListeners,   getFacet,   getFacetCount,   getFacets,   getFacetsAndChildren,   getFamily,   getId,   getParent,   getRenderer,   getRendererType,   getRendersChildren,   getValueBinding,   getValueExpression,   invokeOnComponent,   isRendered,   processDecodes,   processRestoreState,   processSaveState,   processUpdates,   processValidators,   queueEvent,   removeFacesListener,   setId,   setParent,   setRendered,   setRendererType,   setValueBinding,   setValueExpression
Methods from java.lang.Object:
equals,   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 .

    {@inheritDoc}
 public MethodExpression getActionExpression() 
 public MethodBinding getActionListener() 
Deprecated! Use - #getActionListeners instead.

    {@inheritDoc}
 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() 
 public  void queueEvent(FacesEvent e) 

    Intercept queueEvent and, for ActionEvent s, mark the phaseId for the event to be PhaseId.APPLY_REQUEST_VALUES if the immediate flag is true, PhaseId.INVOKE_APPLICATION otherwise.

 public  void removeActionListener(ActionListener listener) 
 public  void restoreState(FacesContext context,
    Object state) 
 public Object saveState(FacesContext context) 
 public  void setAction(MethodBinding action) 
Deprecated! This - has been replaced by #setActionExpression(javax.el.MethodExpression) .

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

    {@inheritDoc}
 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.