Top Description Methods
javax.faces.component

public Interface ActionSource

Known Direct Subinterfaces
javax.faces.component.ActionSource2
Imports
javax.faces.event.ActionEvent, .ActionListener, javax.faces.el.MethodBinding

ActionSource is an interface that may be implemented by any concrete UIComponent that wishes to be a source of ActionEvents, including the ability to invoke application actions via the default ActionListener mechanism.

Method Summary

Modifier and TypeMethod and Description
public void
addActionListener(ActionListener
The ActionListener to be added
listener
)

Add a new ActionListener to the set of listeners interested in being notified when ActionEvents occur.

public MethodBinding

Returns:

the action.
getAction
()

Deprecated This has been replaced by ActionSource2#getActionExpression.

If the implementing class also implements ActionSource2, the implementation of this method must call through to ActionSource2#getActionExpression and examine the result.

public MethodBinding

Returns:

the action listener.
getActionListener
()

Deprecated Use getActionListeners instead.

If setActionListener was not previously called for this instance, this method must return null.

public ActionListener[]

Returns:

the action listeners, or a zero-length array.
getActionListeners
()

Return the set of registered ActionListeners for this ActionSource instance.

public boolean

Returns:

true if immediate, false otherwise.
isImmediate
()

Return a flag indicating that the default ActionListener provided by the JavaServer Faces implementation should be executed immediately (that is, during Apply Request Values phase of the request processing lifecycle), rather than waiting until the Invoke Application phase.

public void
removeActionListener(ActionListener
The ActionListener to be removed
listener
)

Remove an existing ActionListener (if any) from the set of listeners interested in being notified when ActionEvents occur.

public void
setAction(MethodBinding
The new MethodBinding expression
action
)

Deprecated This has been replaced by ActionSource2#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 javax.el.MethodExpression and call through to ActionSource2#setActionExpression, passing the wrapped action.

public void
setActionListener(MethodBinding
The new method binding expression
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 getActionListeners method, taking care to over-write any instance that was stored by a previous call to setActionListener.

public void
setImmediate(boolean
The new immediate execution flag
immediate
)

Set the "immediate execution" flag for this UIComponent.

Method Detail

addActionListenerback to summary
public void addActionListener(ActionListener listener)

Add a new ActionListener to the set of listeners interested in being notified when ActionEvents occur.

Parameters
listener:ActionListener

The ActionListener to be added

Exceptions
NullPointerException:
if listener is null
getActionback to summary
public MethodBinding getAction()

Deprecated

This has been replaced by ActionSource2#getActionExpression.

If the implementing class also implements ActionSource2, the implementation of this method must call through to ActionSource2#getActionExpression and examine the result. If the result came from a previous call to setAction, extract the MethodBinding from it and return it. Otherwise, wrap the returned javax.el.MethodExpression in a MethodBinding implementation, and return it.

If the implementing class does not implement ActionSource2, return the MethodBindingpointing 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.

Returns:MethodBinding

the action.

getActionListenerback to summary
public MethodBinding getActionListener()

Deprecated

Use getActionListeners instead.

If setActionListener was not previously called for this instance, this method must return null. If it was called, this method must return the exact MethodBinding instance that was passed to setActionListener.

The method to be invoked, if this UIComponent is activated by the user, will be called during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending upon the value of the immediate property.

Returns:MethodBinding

the action listener.

getActionListenersback to summary
public ActionListener[] getActionListeners()

Return the set of registered ActionListeners for this ActionSource instance. If there are no registered listeners, a zero-length array is returned.

Returns:ActionListener[]

the action listeners, or a zero-length array.

isImmediateback to summary
public boolean isImmediate()

Return a flag indicating that the default ActionListener provided by the JavaServer Faces implementation should be executed immediately (that is, during Apply Request Values phase of the request processing lifecycle), rather than waiting until the Invoke Application phase. The default value for this property must be false.

Returns:boolean

true if immediate, false otherwise.

removeActionListenerback to summary
public void removeActionListener(ActionListener listener)

Remove an existing ActionListener (if any) from the set of listeners interested in being notified when ActionEvents occur.

Parameters
listener:ActionListener

The ActionListener to be removed

Exceptions
NullPointerException:
if listener is null
setActionback to summary
public void setAction(MethodBinding action)

If the implementing class also implements ActionSource2, the implementation of this method must wrap the argument action in a class that implements javax.el.MethodExpression and call through to ActionSource2#setActionExpression, 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.

Parameters
action:MethodBinding

The new MethodBinding expression

setActionListenerback to summary
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 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.

Parameters
actionListener:MethodBinding

The new method binding expression

setImmediateback to summary
public void setImmediate(boolean immediate)

Set the "immediate execution" flag for this UIComponent.

Parameters
immediate:boolean

The new immediate execution flag