Package org.apache.wicket.ajax.form
Class AjaxFormValidatingBehavior
- java.lang.Object
-
- org.apache.wicket.behavior.Behavior
-
- org.apache.wicket.ajax.form.AjaxFormValidatingBehavior
-
- All Implemented Interfaces:
Serializable
,IComponentAwareEventSink
,IComponentAwareHeaderContributor
,IClusterable
public class AjaxFormValidatingBehavior extends Behavior
Ajax event behavior that submits the form and updates all form feedback panels on the page. Useful for providing instant feedback. Can be bound either to aform
or to a component inside a form.- Since:
- 1.2
- Author:
- Igor Vaynberg (ivaynberg)
- See Also:
onSubmit(org.apache.wicket.ajax.AjaxRequestTarget)
,onAfterSubmit(org.apache.wicket.ajax.AjaxRequestTarget)
,onError(org.apache.wicket.ajax.AjaxRequestTarget)
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AjaxFormValidatingBehavior(String event)
Construct.AjaxFormValidatingBehavior(String event, Duration throttleDelay)
Construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addFeedbackPanels(AjaxRequestTarget target)
Adds all feedback panels on the page to the ajax request target so they are updatedvoid
bind(Component component)
Bind this handler to the given component.protected void
onAfterSubmit(AjaxRequestTarget target)
void
onConfigure(Component component)
Called immediately after the onConfigure method in a component.protected void
onError(AjaxRequestTarget target)
protected void
onSubmit(AjaxRequestTarget target)
protected void
updateAjaxAttributes(AjaxRequestAttributes attributes)
-
Methods inherited from class org.apache.wicket.behavior.Behavior
afterRender, beforeRender, canCallListener, detach, getStatelessHint, isEnabled, isTemporary, onAttribute, onComponentTag, onEvent, onException, onRemove, onTag, renderHead, unbind
-
-
-
-
Constructor Detail
-
AjaxFormValidatingBehavior
public AjaxFormValidatingBehavior(String event)
Construct.- Parameters:
event
- javascript event this behavior will be invoked on, like onclick
-
AjaxFormValidatingBehavior
public AjaxFormValidatingBehavior(String event, Duration throttleDelay)
Construct.- Parameters:
event
- javascript event this behavior will be invoked on, like onclickthrottleDelay
- the duration for which the Ajax call should be throttled
-
-
Method Detail
-
bind
public void bind(Component component)
Description copied from class:Behavior
Bind this handler to the given component. This method is called by the host component immediately after this behavior is added to it. This method is useful if you need to do initialization based on the component it is attached and you can't wait to do it at render time. Keep in mind that if you decide to keep a reference to the host component, it is not thread safe anymore, and should thus only be used in situations where you do not reuse the behavior for multiple components.
-
onConfigure
public void onConfigure(Component component)
Description copied from class:Behavior
Called immediately after the onConfigure method in a component. Since this is before the rendering cycle has begun, the behavior can modify the configuration of the component (i.e. setVisible(false))- Overrides:
onConfigure
in classBehavior
- Parameters:
component
- the component being configured
-
onSubmit
protected void onSubmit(AjaxRequestTarget target)
-
onAfterSubmit
protected void onAfterSubmit(AjaxRequestTarget target)
-
onError
protected void onError(AjaxRequestTarget target)
-
addFeedbackPanels
protected final void addFeedbackPanels(AjaxRequestTarget target)
Adds all feedback panels on the page to the ajax request target so they are updated- Parameters:
target
-
-
updateAjaxAttributes
protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
-
-