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.AjaxPreventSubmitBehavior
- All Implemented Interfaces:
Serializable
,IComponentAwareEventSink
,IRequestListener
,IComponentAwareHeaderContributor
,IClusterable
An Ajax behavior that could be used to prevent the form submit when the user presses the ENTER key while in an HTML <input type="text" > field.
The behavior could be applied to a TextField
or to a parent
container that will apply this behavior to all children of type HTMLInputElement.
This Ajax behavior is client-side only, i.e. it never fires an Ajax call to the server.
- See Also:
-
Field Summary
Fields inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
INDICATOR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected final void
onEvent
(AjaxRequestTarget target) Listener method for the ajax eventprotected void
updateAjaxAttributes
(AjaxRequestAttributes attributes) Gives a chance to the specializations to modify the attributes.Methods inherited from class org.apache.wicket.ajax.AjaxEventBehavior
getEvent, onEvent, renderHead, respond
Methods inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
findIndicatorId, getAttributes, getCallbackFunction, getCallbackFunctionBody, getCallbackScript, getCallbackScript, onBind, onMethodMismatch, 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, canCallListener, detach, getStatelessHint, isEnabled, isTemporary, onAttribute, onConfigure, onEvent, onException, onRemove, onTag
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.wicket.IRequestListener
rendersPage
-
Constructor Details
-
AjaxPreventSubmitBehavior
public AjaxPreventSubmitBehavior()Constructor.
-
-
Method Details
-
updateAjaxAttributes
Description copied from class:AbstractDefaultAjaxBehavior
Gives a chance to the specializations to modify the attributes.- Overrides:
updateAjaxAttributes
in classAjaxEventBehavior
-
onEvent
Description copied from class:AjaxEventBehavior
Listener method for the ajax event- Specified by:
onEvent
in classAjaxEventBehavior
- Parameters:
target
- the current request handler
-