wicket.ajax.form
Class AjaxFormComponentUpdatingBehavior

java.lang.Object
  extended by wicket.behavior.AbstractBehavior
      extended by wicket.behavior.AbstractAjaxBehavior
          extended by wicket.ajax.AbstractDefaultAjaxBehavior
              extended by wicket.ajax.AjaxEventBehavior
                  extended by wicket.ajax.form.AjaxFormComponentUpdatingBehavior
All Implemented Interfaces:
java.io.Serializable, IBehavior, IBehaviorListener, IRequestListener, IHeaderContributor

public abstract class AjaxFormComponentUpdatingBehavior
extends AjaxEventBehavior

A behavior that updates the hosting FormComponent via ajax when an event it is attached to is triggered. This behavior encapsulates the entire form-processing workflow as relevant only to this component so if validation is successfull the component's model will be updated according to the submitted value.

NOTE: This behavior does not support persisting form component values into cookie or other IValuePersister. If this is necessary please add a request for enhancement.

NOTE: This behavior does not validate any IFormValidators attached to this form even though they may reference the component being updated.

Since:
1.2
Author:
Igor Vaynberg (ivaynberg)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class wicket.ajax.AbstractDefaultAjaxBehavior
INDICATOR
 
Fields inherited from interface wicket.behavior.IBehaviorListener
INTERFACE
 
Constructor Summary
AjaxFormComponentUpdatingBehavior(java.lang.String event)
          Construct.
 
Method Summary
protected  java.lang.CharSequence getEventHandler()
           
protected  FormComponent getFormComponent()
           
protected  void onBind()
          Subclasses should call super.onBind()
protected  void onCheckEvent(java.lang.String event)
           
protected  void onError(AjaxRequestTarget target, java.lang.RuntimeException e)
          Called to handle any error resulting from updating form component.
protected  void onEvent(AjaxRequestTarget target)
          Listener method for the ajax event
protected abstract  void onUpdate(AjaxRequestTarget target)
          Listener invoked on the ajax request.
 
Methods inherited from class wicket.ajax.AjaxEventBehavior
getCallbackScript, getEvent, onComponentTag, respond, setThrottleDelay
 
Methods inherited from class wicket.ajax.AbstractDefaultAjaxBehavior
getAjaxCallDecorator, getCallbackScript, getCallbackScript, getImplementationId, onRenderHeadInitContribution, onRequest, throttleScript
 
Methods inherited from class wicket.behavior.AbstractAjaxBehavior
bind, cleanup, getCallbackUrl, getCallbackUrl, getComponent, onComponentRendered, onComponentTag, onRendered, onRenderHeadContribution, renderHead, writeJsReference, writeJsReference
 
Methods inherited from class wicket.behavior.AbstractBehavior
detachModel, exception, onException, rendered
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AjaxFormComponentUpdatingBehavior

public AjaxFormComponentUpdatingBehavior(java.lang.String event)
Construct.

Parameters:
event - event to trigger this behavior
Method Detail

onBind

protected void onBind()
Description copied from class: AbstractDefaultAjaxBehavior
Subclasses should call super.onBind()

Overrides:
onBind in class AbstractDefaultAjaxBehavior
See Also:
AbstractAjaxBehavior.onBind()

getFormComponent

protected final FormComponent getFormComponent()
Returns:
FormComponent

getEventHandler

protected final java.lang.CharSequence getEventHandler()
Overrides:
getEventHandler in class AjaxEventBehavior
Returns:
event handler
See Also:
AjaxEventBehavior.getEventHandler()

onCheckEvent

protected void onCheckEvent(java.lang.String event)
Overrides:
onCheckEvent in class AjaxEventBehavior
See Also:
AjaxEventBehavior.onCheckEvent(java.lang.String)

onEvent

protected final void onEvent(AjaxRequestTarget target)
Description copied from class: AjaxEventBehavior
Listener method for the ajax event

Specified by:
onEvent in class AjaxEventBehavior
See Also:
AjaxEventBehavior.onEvent(wicket.ajax.AjaxRequestTarget)

onUpdate

protected abstract void onUpdate(AjaxRequestTarget target)
Listener invoked on the ajax request. This listener is invoked after the component's model has been updated.

Parameters:
target -

onError

protected void onError(AjaxRequestTarget target,
                       java.lang.RuntimeException e)
Called to handle any error resulting from updating form component. Errors thrown from onUpdate(AjaxRequestTarget) will not be caught here.

Parameters:
target -
e -


Copyright © 2004-2007 Wicket developers. All Rights Reserved.