|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.faces.component.UIComponent
javax.faces.component.UIComponentBase
javax.faces.component.UICommand
@JSFComponent(defaultRendererType="javax.faces.Button") public class UICommand
UICommand is a base abstraction for components that implement ActionSource.
Field Summary | |
---|---|
static String |
COMPONENT_FAMILY
|
static String |
COMPONENT_TYPE
|
Fields inherited from class javax.faces.component.UIComponent |
---|
ATTRS_WITH_DECLARED_DEFAULT_VALUES, BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME, VIEW_LOCATION_KEY |
Constructor Summary | |
---|---|
UICommand()
Construct an instance of the UICommand. |
Method Summary | |
---|---|
void |
addActionListener(ActionListener listener)
|
void |
broadcast(FacesEvent event)
Invoke any listeners attached to this object which are listening for an event whose type matches the specified event's runtime type. |
MethodBinding |
getAction()
Deprecated. Use getActionExpression() instead. |
javax.el.MethodExpression |
getActionExpression()
The action to take when this command is invoked. |
MethodBinding |
getActionListener()
Deprecated. |
ActionListener[] |
getActionListeners()
Event delivered when the "action" of the component has been invoked; for example, by clicking on a button. |
String |
getFamily()
|
Object |
getValue()
The text to display to the user for this command component. |
boolean |
isImmediate()
A boolean value that identifies the phase during which action events should fire. |
void |
queueEvent(FacesEvent event)
|
void |
removeActionListener(ActionListener listener)
|
void |
setAction(MethodBinding action)
Deprecated. Use setActionExpression instead. |
void |
setActionExpression(javax.el.MethodExpression actionExpression)
|
void |
setActionListener(MethodBinding actionListener)
Deprecated. |
void |
setImmediate(boolean immediate)
|
void |
setValue(Object value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String COMPONENT_TYPE
public static final String COMPONENT_FAMILY
Constructor Detail |
---|
public UICommand()
Method Detail |
---|
public MethodBinding getAction()
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.
getAction
in interface ActionSource
public void setAction(MethodBinding action)
setAction
in interface ActionSource
public void broadcast(FacesEvent event) throws AbortProcessingException
UIComponentBase
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.
broadcast
in class UIComponentBase
event
- must not be null.
AbortProcessingException
public void queueEvent(FacesEvent event)
queueEvent
in class UIComponentBase
@JSFProperty public boolean isImmediate()
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.
isImmediate
in interface ActionSource
public void setImmediate(boolean immediate)
setImmediate
in interface ActionSource
@JSFProperty public Object getValue()
public void setValue(Object value)
@JSFProperty(stateHolder=true, returnSignature="java.lang.Object", jspName="action", clientEvent="action") public javax.el.MethodExpression getActionExpression()
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.
getActionExpression
in interface ActionSource2
public void setActionExpression(javax.el.MethodExpression actionExpression)
setActionExpression
in interface ActionSource2
@JSFProperty(stateHolder=true, returnSignature="void", methodSignature="javax.faces.event.ActionEvent") public MethodBinding getActionListener()
An action listener method accepts a parameter of type javax.faces.event.ActionEvent and returns void. The phase that this event is fired in can be controlled via the immediate attribute.
getActionListener
in interface ActionSource
@JSFProperty(returnSignature="void", methodSignature="javax.faces.event.ActionEvent") public void setActionListener(MethodBinding actionListener)
setActionListener
in interface ActionSource
public void addActionListener(ActionListener listener)
addActionListener
in interface ActionSource
public void removeActionListener(ActionListener listener)
removeActionListener
in interface ActionSource
@JSFListener(event="javax.faces.event.ActionEvent", phases="Invoke Application, Apply Request Values") public ActionListener[] getActionListeners()
getActionListeners
in interface ActionSource
public String getFamily()
getFamily
in class UIComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |