org.apache.myfaces.custom.updateactionlistener
Class UpdateActionListener
java.lang.Object
org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
- All Implemented Interfaces:
- java.util.EventListener, javax.faces.component.StateHolder, javax.faces.component.ValueHolder, javax.faces.event.ActionListener, javax.faces.event.FacesListener
public class UpdateActionListener
- extends java.lang.Object
- implements javax.faces.event.ActionListener, javax.faces.component.ValueHolder, javax.faces.component.StateHolder
Set an arbitrary property on a managed bean when an "action" component is
selected by the user.
An instance of this listener type can be attached to any UIComponent which
is an ActionSource (eg a link or button). When the associated component
fires its action event, this listener will read the value specified by
attribute "value" and assign it to the property specified by attribute
"property". The value attribute may be a literal value or may be a
value-binding; the property is always expected to be a value-binding.
An optional Converter may be associated with this listener, and if present
will be invoked to convert the value to the datatype expected by the
target property. When no converter is available, a default one will be
retrieved from the Application object.
A common use for this listener is to attach it to an HtmlCommandLink
component, storing some constant value into a managed bean property.
After the navigation associated with that link is done, components in
the new view can look at that property to determine which link was
clicked.
Both the fetching of "value" and the updating of "property" occur in
the invoke-application phase unless "immediate" is set on the ActionSource
component in which case they both occur in the apply-request-values phase.
The update is guaranteed to occur before the invocation of the method
specified by attribute "action" on the ActionSource (because all
actionListeners are executed before the action attribute).
- Version:
- $Revision: 358844 $ $Date: 2005-12-23 13:15:54 -0500 (Fri, 23 Dec 2005) $
- Author:
- Manfred Geiler (latest modification by $Author: mkienenb $)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UpdateActionListener
public UpdateActionListener()
setPropertyBinding
public void setPropertyBinding(javax.faces.el.ValueBinding propertyBinding)
getPropertyBinding
public javax.faces.el.ValueBinding getPropertyBinding()
setValue
public void setValue(java.lang.Object value)
- Specified by:
setValue
in interface javax.faces.component.ValueHolder
getValue
public java.lang.Object getValue()
- Specified by:
getValue
in interface javax.faces.component.ValueHolder
getLocalValue
public java.lang.Object getLocalValue()
- Specified by:
getLocalValue
in interface javax.faces.component.ValueHolder
getValueBinding
public javax.faces.el.ValueBinding getValueBinding()
setValueBinding
public void setValueBinding(javax.faces.el.ValueBinding valueBinding)
getConverter
public javax.faces.convert.Converter getConverter()
- Specified by:
getConverter
in interface javax.faces.component.ValueHolder
setConverter
public void setConverter(javax.faces.convert.Converter converter)
- Specified by:
setConverter
in interface javax.faces.component.ValueHolder
processAction
public void processAction(javax.faces.event.ActionEvent actionEvent)
throws javax.faces.event.AbortProcessingException
- Specified by:
processAction
in interface javax.faces.event.ActionListener
- Throws:
javax.faces.event.AbortProcessingException
saveState
public java.lang.Object saveState(javax.faces.context.FacesContext context)
- Specified by:
saveState
in interface javax.faces.component.StateHolder
restoreState
public void restoreState(javax.faces.context.FacesContext context,
java.lang.Object state)
- Specified by:
restoreState
in interface javax.faces.component.StateHolder
isTransient
public boolean isTransient()
- Specified by:
isTransient
in interface javax.faces.component.StateHolder
setTransient
public void setTransient(boolean newTransientValue)
- Specified by:
setTransient
in interface javax.faces.component.StateHolder
Copyright 2006 Apache Software Foundation. All Rights Reserved.