public abstract class AjaxFormComponentUpdatingBehavior extends AjaxEventBehavior
NOTE: This behavior does not validate any IFormValidators attached to this form even
though they may reference the component being updated.
NOTE: This behavior does not work on Choices or Groups use the
AjaxFormChoiceComponentUpdatingBehavior for that.
onUpdate(org.apache.wicket.ajax.AjaxRequestTarget),
onError(org.apache.wicket.ajax.AjaxRequestTarget, RuntimeException),
Serialized FormINDICATOR| Constructor and Description |
|---|
AjaxFormComponentUpdatingBehavior(String event)
Construct.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkComponent(FormComponent<?> component)
Check the component this behavior is bound to.
|
protected boolean |
disableFocusOnBlur()
Determines whether the focus will not be restored when the event is blur.
|
protected FormComponent<?> |
getFormComponent() |
protected boolean |
getUpdateModel()
Gives the control to the application to decide whether the form component model should
be updated automatically or not.
|
protected void |
onBind()
Subclasses should call super.onBind()
|
protected void |
onError(AjaxRequestTarget target,
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.
|
static AjaxFormComponentUpdatingBehavior |
onUpdate(String eventName,
org.danekja.java.util.function.serializable.SerializableConsumer<AjaxRequestTarget> onUpdate)
Creates an
AjaxFormComponentUpdatingBehavior based on lambda expressions |
protected void |
updateAjaxAttributes(AjaxRequestAttributes attributes)
Gives a chance to the specializations to modify the attributes.
|
getEvent, onEvent, renderHead, respondfindIndicatorId, getAttributes, getCallbackFunction, getCallbackFunctionBody, getCallbackScript, getCallbackScript, onRequest, postprocessConfiguration, renderAjaxAttributes, renderAjaxAttributesafterRender, bind, getCallbackUrl, getComponent, onComponentRendered, onComponentTag, onComponentTag, onUnbind, unbindbeforeRender, canCallListener, detach, getStatelessHint, isEnabled, isTemporary, onAttribute, onConfigure, onEvent, onException, onRemove, onTagclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrendersPagepublic AjaxFormComponentUpdatingBehavior(String event)
event - event to trigger this behaviorprotected void onBind()
AbstractDefaultAjaxBehavioronBind in class AbstractDefaultAjaxBehaviorAbstractAjaxBehavior.onBind()protected void checkComponent(FormComponent<?> component)
Logs a warning in development mode when an AjaxFormChoiceComponentUpdatingBehavior
should be used.
component - bound componentprotected final FormComponent<?> getFormComponent()
protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
AbstractDefaultAjaxBehaviorupdateAjaxAttributes in class AjaxEventBehaviorprotected final void onEvent(AjaxRequestTarget target)
AjaxEventBehavioronEvent in class AjaxEventBehaviortarget - the current request handlerAjaxEventBehavior.onEvent(org.apache.wicket.ajax.AjaxRequestTarget)protected boolean getUpdateModel()
FormComponent.valid()
additionally in case the application want to update the model manually.protected boolean disableFocusOnBlur()
true if refocusing should be disabled, false otherwiseprotected abstract void onUpdate(AjaxRequestTarget target)
Note: onError(AjaxRequestTarget, RuntimeException) is called instead when processing
of the FormComponent failed with conversion or validation errors!
target - the current request handlerprotected void onError(AjaxRequestTarget target, RuntimeException e)
onUpdate(org.apache.wicket.ajax.AjaxRequestTarget) will not be caught here.
The RuntimeException will be null if it was just a validation or conversion error of the
FormComponenttarget - the current request handlere - the error that occurred during the update of the componentpublic static AjaxFormComponentUpdatingBehavior onUpdate(String eventName, org.danekja.java.util.function.serializable.SerializableConsumer<AjaxRequestTarget> onUpdate)
AjaxFormComponentUpdatingBehavior based on lambda expressionseventName - the event nameonUpdate - the SerializableConsumer which accepts the AjaxRequestTargetAjaxFormComponentUpdatingBehaviorCopyright © 2006–2018 Apache Software Foundation. All rights reserved.