-
- All Known Subinterfaces:
- ActionSource2
- All Known Implementing Classes:
- HtmlCommandButton, HtmlCommandLink, UICommand, UIViewAction
public interface ActionSource
ActionSource is an interface that may be implemented by any concrete
UIComponent
that wishes to be a source ofActionEvent
s, including the ability to invoke application actions via the defaultActionListener
mechanism.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method and Description void
addActionListener(ActionListener listener)
Add a newActionListener
to the set of listeners interested in being notified whenActionEvent
s occur.MethodBinding
getAction()
Deprecated.This has been replaced byActionSource2.getActionExpression()
.MethodBinding
getActionListener()
Deprecated.UsegetActionListeners()
instead.ActionListener[]
getActionListeners()
Return the set of registeredActionListener
s for thisActionSource
instance.boolean
isImmediate()
Return a flag indicating that the defaultActionListener
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.void
removeActionListener(ActionListener listener)
Remove an existingActionListener
(if any) from the set of listeners interested in being notified whenActionEvent
s occur.void
setAction(MethodBinding action)
Deprecated.This has been replaced byActionSource2.setActionExpression(javax.el.MethodExpression)
.void
setActionListener(MethodBinding actionListener)
Deprecated.This has been replaced byaddActionListener(javax.faces.event.ActionListener)
.void
setImmediate(boolean immediate)
Set the "immediate execution" flag for thisUIComponent
.
-
-
-
Method Detail
-
getAction
MethodBinding getAction()
Deprecated. This has been replaced byActionSource2.getActionExpression()
.If the implementing class also implements
ActionSource2
, the implementation of this method must call through toActionSource2.getActionExpression()
and examine the result. If the result came from a previous call tosetAction(javax.faces.el.MethodBinding)
, extract theMethodBinding
from it and return it. Otherwise, wrap the returnedMethodExpression
in aMethodBinding
implementation, and return it.If the implementing class does not implement
ActionSource2
, return theMethodBinding
pointing at the application action to be invoked, if thisUIComponent
is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of theimmediate
property.
-
setAction
void setAction(MethodBinding action)
Deprecated. This has been replaced byActionSource2.setActionExpression(javax.el.MethodExpression)
.If the implementing class also implements
ActionSource2
, the implementation of this method must wrap the argumentaction
in a class that implementsMethodExpression
and call through toActionSource2.setActionExpression(javax.el.MethodExpression)
, passing the wrappedaction
.If the implementing class does not implement
ActionSource2
, set theMethodBinding
pointing at the appication action to be invoked, if thisUIComponent
is activated by the user, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of theimmediate
property.Any method referenced by such an expression must be public, with a return type of
String
, and accept no parameters.- Parameters:
action
- The new MethodBinding expression
-
getActionListener
MethodBinding getActionListener()
Deprecated. UsegetActionListeners()
instead.If
setActionListener(javax.faces.el.MethodBinding)
was not previously called for this instance, this method must returnnull
. If it was called, this method must return the exactMethodBinding
instance that was passed tosetActionListener(javax.faces.el.MethodBinding)
.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 theimmediate
property.
-
setActionListener
void setActionListener(MethodBinding actionListener)
Deprecated. This has been replaced byaddActionListener(javax.faces.event.ActionListener)
.Wrap the argument
actionListener
in an implementation ofActionListener
and store it in the internal data structure that backs thegetActionListeners()
method, taking care to over-write any instance that was stored by a previous call tosetActionListener
.Any method referenced by such an expression must be public, with a return type of
void
, and accept a single parameter of typeActionEvent
.- Parameters:
actionListener
- The new method binding expression
-
isImmediate
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 befalse
.
-
setImmediate
void setImmediate(boolean immediate)
Set the "immediate execution" flag for this
UIComponent
.- Parameters:
immediate
- The new immediate execution flag
-
addActionListener
void addActionListener(ActionListener listener)
Add a new
ActionListener
to the set of listeners interested in being notified whenActionEvent
s occur.- Parameters:
listener
- TheActionListener
to be added- Throws:
NullPointerException
- iflistener
isnull
-
getActionListeners
ActionListener[] getActionListeners()
Return the set of registered
ActionListener
s for thisActionSource
instance. If there are no registered listeners, a zero-length array is returned.
-
removeActionListener
void removeActionListener(ActionListener listener)
Remove an existing
ActionListener
(if any) from the set of listeners interested in being notified whenActionEvent
s occur.- Parameters:
listener
- TheActionListener
to be removed- Throws:
NullPointerException
- iflistener
isnull
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
21/08/2025 18:31:21 Cette version de la page est en cache (à la date du 21/08/2025 18:31:21) afin d'accélérer le traitement.Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.
Document créé le 14/04/2008, dernière modification le 18/08/2025
Source du document imprimé : https://www.gaudry.be/java-api-javaee-rf-javax/faces/component/ActionSource.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.