Class UICommand

All Implemented Interfaces:
EventListener, ActionSource, ActionSource2, PartialStateHolder, StateHolder, TransientStateHolder, ComponentSystemEventListener, FacesListener, SystemEventListenerHolder
Direct Known Subclasses:
HtmlCommandButton, HtmlCommandLink, HtmlCommandScript

public class UICommand extends UIComponentBase implements ActionSource2

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. ActionListeners, 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 Details

    • COMPONENT_TYPE

      public static final String COMPONENT_TYPE

      The standard component type for this component.

      See Also:
    • COMPONENT_FAMILY

      public static final String COMPONENT_FAMILY

      The standard component family for this component.

      See Also:
  • Constructor Details

    • UICommand

      public UICommand()

      Create a new UICommand instance with default property values.

  • Method Details