org.apache.wicket.ajax.form
Class AjaxFormChoiceComponentUpdatingBehavior

java.lang.Object
  extended by org.apache.wicket.behavior.Behavior
      extended by org.apache.wicket.behavior.AbstractAjaxBehavior
          extended by org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
              extended by org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior
All Implemented Interfaces:
java.io.Serializable, IBehaviorListener, IClusterable, IComponentAwareEventSink, IRequestListener, IComponentAwareHeaderContributor

public abstract class AjaxFormChoiceComponentUpdatingBehavior
extends AbstractDefaultAjaxBehavior

This is a Ajax Component Update Behavior that is meant for choices/groups that are not one component in the html but many.

Use the normal AjaxFormChoiceComponentUpdatingBehavior for the normal single component fields

In order to be supported by this behavior the group components must output children with markup id in format of 'groupId-childId'

Author:
jcompagner
See Also:
RadioChoice, CheckBoxMultipleChoice, RadioGroup, CheckGroup, Serialized Form

Field Summary
 
Fields inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
INDICATOR
 
Fields inherited from interface org.apache.wicket.behavior.IBehaviorListener
INTERFACE
 
Constructor Summary
AjaxFormChoiceComponentUpdatingBehavior()
          Default constructor
 
Method Summary
protected  java.lang.CharSequence getEventHandler()
           
protected  FormComponent<?> getFormComponent()
           
protected  void onBind()
          Subclasses should call super.onBind()
protected  void onError(AjaxRequestTarget target, java.lang.RuntimeException e)
          Called to handle any error resulting from updating form component.
protected abstract  void onUpdate(AjaxRequestTarget target)
          Listener invoked on the ajax request.
 void renderHead(Component component, IHeaderResponse response)
          Render to the web response whatever the component wants to contribute to the head section.
protected  void respond(AjaxRequestTarget target)
           
 
Methods inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
findIndicatorId, generateCallbackScript, getAjaxCallDecorator, getCallbackScript, getChannel, getChannelName, getFailureScript, getPreconditionScript, getSuccessScript, onRequest, throttleScript
 
Methods inherited from class org.apache.wicket.behavior.AbstractAjaxBehavior
afterRender, bind, getCallbackUrl, getComponent, getStatelessHint, onComponentRendered, onComponentTag, onComponentTag
 
Methods inherited from class org.apache.wicket.behavior.Behavior
beforeRender, canCallListenerInterface, detach, isEnabled, isTemporary, onConfigure, onEvent, onException, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AjaxFormChoiceComponentUpdatingBehavior

public AjaxFormChoiceComponentUpdatingBehavior()
Default constructor

Method Detail

renderHead

public void renderHead(Component component,
                       IHeaderResponse response)
Description copied from class: Behavior
Render to the web response whatever the component wants to contribute to the head section.

Specified by:
renderHead in interface IComponentAwareHeaderContributor
Overrides:
renderHead in class AbstractDefaultAjaxBehavior
Parameters:
component - component which is contributing to the response. This parameter is here to give the component as the context for component-awares implementing this interface
response - Response object
See Also:
Behavior.renderHead(Component,org.apache.wicket.markup.html.IHeaderResponse)

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. The RuntimeException will be null if it was just a validation or conversion error of the FormComponent

Parameters:
target -
e -

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()
Returns:
event handler

respond

protected final void respond(AjaxRequestTarget target)
Specified by:
respond in class AbstractDefaultAjaxBehavior
Parameters:
target - The AJAX target
See Also:
AbstractDefaultAjaxBehavior.respond(org.apache.wicket.ajax.AjaxRequestTarget)


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.