org.apache.wicket.ajax.form
Class AjaxFormSubmitBehavior
java.lang.Object
org.apache.wicket.behavior.Behavior
org.apache.wicket.behavior.AbstractAjaxBehavior
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
org.apache.wicket.ajax.AjaxEventBehavior
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior
- All Implemented Interfaces:
- Serializable, IBehaviorListener, IEventSink, IClusterable, IRequestListener, IHeaderContributor
- Direct Known Subclasses:
- AjaxFormValidatingBehavior
public abstract class AjaxFormSubmitBehavior
- extends AjaxEventBehavior
Ajax event behavior that submits a form via ajax when the event it is attached to, is invoked.
The form must have an id attribute in the markup or have MarkupIdSetter added.
- Since:
- 1.2
- Author:
- Igor Vaynberg (ivaynberg)
- See Also:
AjaxEventBehavior
,
Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AjaxFormSubmitBehavior
public AjaxFormSubmitBehavior(String event)
- Constructor. This constructor can only be used when the component this behavior is attached
to is inside a form.
- Parameters:
event
- javascript event this behavior is attached to, like onclick
AjaxFormSubmitBehavior
public AjaxFormSubmitBehavior(Form<?> form,
String event)
- Construct.
- Parameters:
form
- form that will be submittedevent
- javascript event this behavior is attached to, like onclick
getForm
public final Form<?> getForm()
- Returns:
- Form that will be submitted by this behavior
getEventHandler
protected CharSequence getEventHandler()
- Overrides:
getEventHandler
in class AjaxEventBehavior
- Returns:
- event handler
- See Also:
AjaxEventBehavior.getEventHandler()
onEvent
protected 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(org.apache.wicket.ajax.AjaxRequestTarget)
onSubmit
protected abstract void onSubmit(AjaxRequestTarget target)
- Listener method that is invoked after the form has been submitted and processed without
errors
- Parameters:
target
-
onError
protected abstract void onError(AjaxRequestTarget target)
- Listener method invoked when the form has been processed and errors occurred
- Parameters:
target
-
getPreconditionScript
protected CharSequence getPreconditionScript()
- Overrides:
getPreconditionScript
in class AbstractDefaultAjaxBehavior
- Returns:
- an optional javascript expression that determines whether the request will actually
execute (in form of return XXX;);
- See Also:
AbstractDefaultAjaxBehavior.getPreconditionScript()
getDefaultProcessing
public boolean getDefaultProcessing()
- Returns:
true
for default processing- See Also:
Button.getDefaultFormProcessing()
setDefaultProcessing
public void setDefaultProcessing(boolean defaultProcessing)
- Parameters:
defaultProcessing
- - See Also:
Button.setDefaultFormProcessing(boolean)
Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.