Class UICommand

    • Field Detail

      • COMPONENT_TYPE

        public static final java.lang.String COMPONENT_TYPE

        The standard component type for this component.

        See Also:
        Constant Field Values
      • COMPONENT_FAMILY

        public static final java.lang.String COMPONENT_FAMILY

        The standard component family for this component.

        See Also:
        Constant Field Values
    • Constructor Detail

      • UICommand

        public UICommand​()

        Create a new UICommand instance with default property values.

    • Method Detail

      • getFamily

        public java.lang.String getFamily​()
        Description copied from class: UIComponent

        Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance. Note this method should NOT return null

        Specified by:
        getFamily in class UIComponent
        Returns:
        the component family (not null).
      • setAction

        public void setAction​(MethodBinding action)
        Deprecated. This has been replaced by setActionExpression(javax.el.MethodExpression).

        If the implementing class also implements ActionSource2, the implementation of this method must wrap the argument action in a class that implements MethodExpression and call through to ActionSource2.setActionExpression(javax.el.MethodExpression), passing the wrapped action.

        If the implementing class does not implement ActionSource2, set the MethodBinding pointing at the appication action to be invoked, if this UIComponent is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property.

        Any method referenced by such an expression must be public, with a return type of String, and accept no parameters.

        Specified by:
        setAction in interface ActionSource
        Parameters:
        action - The new MethodBinding expression
      • setActionListener

        public void setActionListener​(MethodBinding actionListener)
        Deprecated. This has been replaced by addActionListener(javax.faces.event.ActionListener).

        Wrap the argument actionListener in an implementation of ActionListener and store it in the internal data structure that backs the ActionSource.getActionListeners() method, taking care to over-write any instance that was stored by a previous call to setActionListener.

        Any method referenced by such an expression must be public, with a return type of void, and accept a single parameter of type ActionEvent.

        Specified by:
        setActionListener in interface ActionSource
        Parameters:
        actionListener - The new method binding expression
      • isImmediate

        public boolean isImmediate​()

        The immediate flag.

        Specified by:
        isImmediate in interface ActionSource
        Returns:
        true if immediate, false otherwise.
      • setImmediate

        public void setImmediate​(boolean immediate)
        Description copied from interface: ActionSource

        Set the "immediate execution" flag for this UIComponent.

        Specified by:
        setImmediate in interface ActionSource
        Parameters:
        immediate - The new immediate execution flag
      • getValue

        public java.lang.Object getValue​()

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

        Returns:
        The object representing the value of this component.
      • setValue

        public void setValue​(java.lang.Object value)

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

        Parameters:
        value - the new value
      • getActionExpression

        public MethodExpression getActionExpression​()
        Description copied from interface: ActionSource2

        Return the MethodExpression pointing at the application action to be invoked, if this UIComponent is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property.

        Note that it's possible that the returned MethodExpression is just a wrapper around a MethodBinding instance whith was set by a call to ActionSource.setAction(javax.faces.el.MethodBinding). This makes it possible for the default ActionListener to continue to work properly with older components.

        Specified by:
        getActionExpression in interface ActionSource2
        Returns:
        the action expression.
      • setActionExpression

        public void setActionExpression​(MethodExpression actionExpression)
        Description copied from interface: ActionSource2

        Set the MethodExpression pointing at the appication action to be invoked, if this UIComponent is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property.

        Any method referenced by such an expression must be public, with a return type of String, and accept no parameters.

        Specified by:
        setActionExpression in interface ActionSource2
        Parameters:
        actionExpression - The new method expression
      • queueEvent

        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.

        Overrides:
        queueEvent in class UIComponentBase
        Parameters:
        e - FacesEvent to be queued