|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.wicket.behavior.Behavior
org.apache.wicket.behavior.AbstractAjaxBehavior
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
org.apache.wicket.ajax.AjaxEventBehavior
org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior
public abstract class AjaxFormComponentUpdatingBehavior
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 successful the component's model will be updated according to the submitted value.
NOTE: This behavior does not validate any IFormValidator
s 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 FormField Summary |
---|
Fields inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior |
---|
INDICATOR |
Fields inherited from interface org.apache.wicket.behavior.IBehaviorListener |
---|
INTERFACE |
Constructor Summary | |
---|---|
AjaxFormComponentUpdatingBehavior(String event)
Construct. |
Method Summary | |
---|---|
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. |
protected void |
updateAjaxAttributes(AjaxRequestAttributes attributes)
Gives a chance to the specializations to modify the attributes. |
Methods inherited from class org.apache.wicket.ajax.AjaxEventBehavior |
---|
getEvent, onCheckEvent, renderHead, respond |
Methods inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior |
---|
findIndicatorId, getAttributes, getCallbackFunction, getCallbackFunctionBody, getCallbackScript, getCallbackScript, getChannel, getFailureScript, getPreconditionScript, getSuccessScript, onRequest, postprocessConfiguration, renderAjaxAttributes, renderAjaxAttributes |
Methods inherited from class org.apache.wicket.behavior.AbstractAjaxBehavior |
---|
afterRender, bind, getCallbackUrl, getComponent, onComponentRendered, onComponentTag, onComponentTag, onUnbind, unbind |
Methods inherited from class org.apache.wicket.behavior.Behavior |
---|
beforeRender, canCallListenerInterface, detach, getStatelessHint, isEnabled, isTemporary, onConfigure, onEvent, onException, onRemove |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AjaxFormComponentUpdatingBehavior(String event)
event
- event to trigger this behaviorMethod Detail |
---|
protected void onBind()
AbstractDefaultAjaxBehavior
onBind
in class AbstractDefaultAjaxBehavior
AbstractAjaxBehavior.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)
AbstractDefaultAjaxBehavior
updateAjaxAttributes
in class AjaxEventBehavior
protected final void onEvent(AjaxRequestTarget target)
AjaxEventBehavior
onEvent
in class AjaxEventBehavior
target
- 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)
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
FormComponent
target
- the current request handlere
- the error that occurred during the update of the component
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |