|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
public class UpdateActionListener
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).
JSF 1.2 introduces a "setPropertyActionListener" with the same functionality like this.
Constructor Summary | |
---|---|
UpdateActionListener()
|
Method Summary | |
---|---|
javax.faces.convert.Converter |
getConverter()
|
Object |
getLocalValue()
|
javax.faces.el.ValueBinding |
getPropertyBinding()
|
Object |
getValue()
|
javax.faces.el.ValueBinding |
getValueBinding()
|
boolean |
isTransient()
|
void |
processAction(javax.faces.event.ActionEvent actionEvent)
|
void |
restoreState(javax.faces.context.FacesContext context,
Object state)
|
Object |
saveState(javax.faces.context.FacesContext context)
|
void |
setConverter(javax.faces.convert.Converter converter)
|
void |
setPropertyBinding(javax.faces.el.ValueBinding propertyBinding)
|
void |
setTransient(boolean newTransientValue)
|
void |
setValue(Object value)
|
void |
setValueBinding(javax.faces.el.ValueBinding valueBinding)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UpdateActionListener()
Method Detail |
---|
public void setPropertyBinding(javax.faces.el.ValueBinding propertyBinding)
public javax.faces.el.ValueBinding getPropertyBinding()
public void setValue(Object value)
setValue
in interface javax.faces.component.ValueHolder
public Object getValue()
getValue
in interface javax.faces.component.ValueHolder
public Object getLocalValue()
getLocalValue
in interface javax.faces.component.ValueHolder
public javax.faces.el.ValueBinding getValueBinding()
public void setValueBinding(javax.faces.el.ValueBinding valueBinding)
public javax.faces.convert.Converter getConverter()
getConverter
in interface javax.faces.component.ValueHolder
public void setConverter(javax.faces.convert.Converter converter)
setConverter
in interface javax.faces.component.ValueHolder
public void processAction(javax.faces.event.ActionEvent actionEvent) throws javax.faces.event.AbortProcessingException
processAction
in interface javax.faces.event.ActionListener
javax.faces.event.AbortProcessingException
public Object saveState(javax.faces.context.FacesContext context)
saveState
in interface javax.faces.component.StateHolder
public void restoreState(javax.faces.context.FacesContext context, Object state)
restoreState
in interface javax.faces.component.StateHolder
public boolean isTransient()
isTransient
in interface javax.faces.component.StateHolder
public void setTransient(boolean newTransientValue)
setTransient
in interface javax.faces.component.StateHolder
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |