Class UICommand
- java.lang.Object
- 
- jakarta.faces.component.UIComponent
- 
- jakarta.faces.component.UIComponentBase
- 
- jakarta.faces.component.UICommand
 
 
 
- 
- All Implemented Interfaces:
- ActionSource,- ActionSource2,- PartialStateHolder,- StateHolder,- TransientStateHolder,- ComponentSystemEventListener,- FacesListener,- SystemEventListenerHolder,- EventListener
 - Direct Known Subclasses:
- HtmlCommandButton,- HtmlCommandLink,- HtmlCommandScript
 
 @JSFComponent(defaultRendererType="jakarta.faces.Button") public class UICommand extends UIComponentBase implements ActionSource2 UICommand is a base abstraction for components that implement ActionSource.
- 
- 
Field SummaryFields Modifier and Type Field Description static StringCOMPONENT_FAMILYstatic StringCOMPONENT_TYPE- 
Fields inherited from class jakarta.faces.component.UIComponentATTRS_WITH_DECLARED_DEFAULT_VALUES, BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, FACETS_KEY, VIEW_LOCATION_KEY
 
- 
 - 
Constructor SummaryConstructors Constructor Description UICommand()Construct an instance of the UICommand.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddActionListener(ActionListener listener)voidbroadcast(FacesEvent event)Invoke any listeners attached to this object which are listening for an event whose type matches the specified event's runtime type.jakarta.el.MethodExpressiongetActionExpression()The action to take when this command is invoked.ActionListener[]getActionListeners()Event delivered when the "action" of the component has been invoked; for example, by clicking on a button.StringgetFamily()ObjectgetValue()The text to display to the user for this command component.booleanisImmediate()A boolean value that identifies the phase during which action events should fire.voidqueueEvent(FacesEvent event)voidremoveActionListener(ActionListener listener)voidsetActionExpression(jakarta.el.MethodExpression actionExpression)voidsetImmediate(boolean immediate)voidsetValue(Object value)- 
Methods inherited from class jakarta.faces.component.UIComponentBaseaddClientBehavior, addFacesListener, clearInitialState, decode, encodeAll, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getPassThroughAttributes, getRenderer, getRendererType, getRendersChildren, invokeOnComponent, isRendered, isTransient, markInitialState, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, visitTree
 - 
Methods inherited from class jakarta.faces.component.UIComponentgetClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getListenersForEventClass, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression, subscribeToEvent, unsubscribeFromEvent
 
- 
 
- 
- 
- 
Field Detail- 
COMPONENT_TYPEpublic static final String COMPONENT_TYPE - See Also:
- Constant Field Values
 
 - 
COMPONENT_FAMILYpublic static final String COMPONENT_FAMILY - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
broadcastpublic void broadcast(FacesEvent event) throws AbortProcessingException Description copied from class:UIComponentBaseInvoke any listeners attached to this object which are listening for an event whose type matches the specified event's runtime type.This method does not propagate the event up to parent components, ie listeners attached to parent components don't automatically get called. If any of the listeners throws AbortProcessingException then that exception will prevent any further listener callbacks from occurring, and the exception propagates out of this method without alteration. ActionEvent events are typically queued by the renderer associated with this component in its decode method; ValueChangeEvent events by the component's validate method. In either case the event's source property references a component. At some later time the UIViewRoot component iterates over its queued events and invokes the broadcast method on each event's source object. - Overrides:
- broadcastin class- UIComponentBase
- Parameters:
- event- must not be null.
- Throws:
- AbortProcessingException
 
 - 
queueEventpublic void queueEvent(FacesEvent event) - Overrides:
- queueEventin class- UIComponentBase
 
 - 
isImmediate@JSFProperty public boolean isImmediate() A boolean value that identifies the phase during which action events should fire.During normal event processing, action methods and action listener methods are fired during the "invoke application" phase of request processing. If this attribute is set to "true", these methods are fired instead at the end of the "apply request values" phase. - Specified by:
- isImmediatein interface- ActionSource
 
 - 
setImmediatepublic void setImmediate(boolean immediate) - Specified by:
- setImmediatein interface- ActionSource
 
 - 
getValue@JSFProperty public Object getValue() The text to display to the user for this command component.
 - 
setValuepublic void setValue(Object value) 
 - 
getActionExpression@JSFProperty(stateHolder=true, returnSignature="java.lang.Object", clientEvent="action") public jakarta.el.MethodExpression getActionExpression()The action to take when this command is invoked.If the value is an expression, it is expected to be a method binding EL expression that identifies an action method. An action method accepts no parameters and has a String return value, called the action outcome, that identifies the next view displayed. The phase that this event is fired in can be controlled via the immediate attribute. If the value is a string literal, it is treated as a navigation outcome for the current view. This is functionally equivalent to a reference to an action method that returns the string literal. - Specified by:
- getActionExpressionin interface- ActionSource2
 
 - 
setActionExpressionpublic void setActionExpression(jakarta.el.MethodExpression actionExpression) - Specified by:
- setActionExpressionin interface- ActionSource2
 
 - 
addActionListenerpublic void addActionListener(ActionListener listener) - Specified by:
- addActionListenerin interface- ActionSource
 
 - 
removeActionListenerpublic void removeActionListener(ActionListener listener) - Specified by:
- removeActionListenerin interface- ActionSource
 
 - 
getActionListeners@JSFListener(event="jakarta.faces.event.ActionEvent", phases="Invoke Application, Apply Request Values") public ActionListener[] getActionListeners()Event delivered when the "action" of the component has been invoked; for example, by clicking on a button. The action may result in page navigation.- Specified by:
- getActionListenersin interface- ActionSource
 
 - 
getFamilypublic String getFamily() - Specified by:
- getFamilyin class- UIComponent
 
 
- 
 
-