public class AjaxFormComponentValidatorBehaviour
extends org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior
Modifier and Type | Field and Description |
---|---|
static String |
ERROR_COMPONENT_CLASS |
static String |
ERROR_MESSAGE_CLASS |
Constructor and Description |
---|
AjaxFormComponentValidatorBehaviour() |
AjaxFormComponentValidatorBehaviour(String event) |
Modifier and Type | Method and Description |
---|---|
protected String |
getErrorJavascript()
Returns the javascript that will manipulate the markup to show the error message.
|
protected String |
getErrorSeparator()
The error separator is used to differentiate each error-message in case a component has more
than one error message
Defaults to separating using a
tag. |
protected String |
getRemovePreviousErrorsScript()
Javascript used to remove previously shown error messages.
|
protected void |
onError(org.apache.wicket.ajax.AjaxRequestTarget target,
RuntimeException e)
Adds the error-javascript to the response since the component has errors.
|
protected void |
onUpdate(org.apache.wicket.ajax.AjaxRequestTarget target)
When the component renders, onUpdate will remove the markup containing any previous
error-message.
|
void |
renderHead(org.apache.wicket.Component component,
org.apache.wicket.markup.head.IHeaderResponse response)
Add the JQuery library so we can use it in the onError method to manipulate the markup.
|
checkComponent, disableFocusOnBlur, getFormComponent, getUpdateModel, onBind, onEvent, updateAjaxAttributes
getEvent, onCheckEvent, respond
findIndicatorId, getAttributes, getCallbackFunction, getCallbackFunctionBody, getCallbackScript, getCallbackScript, getChannel, getFailureScript, getPreconditionScript, getSuccessScript, onRequest, postprocessConfiguration, renderAjaxAttributes, renderAjaxAttributes
afterRender, bind, getCallbackUrl, getComponent, onComponentRendered, onComponentTag, onComponentTag, onUnbind, unbind
public static final String ERROR_COMPONENT_CLASS
public static final String ERROR_MESSAGE_CLASS
public AjaxFormComponentValidatorBehaviour()
public AjaxFormComponentValidatorBehaviour(String event)
protected void onUpdate(org.apache.wicket.ajax.AjaxRequestTarget target)
onUpdate
in class org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior
target
- protected String getRemovePreviousErrorsScript()
protected void onError(org.apache.wicket.ajax.AjaxRequestTarget target, RuntimeException e)
onError
in class org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior
target
- The AjaxRequestTarget you can add components toe
- The exception if anyprotected String getErrorJavascript()
or
protected String getErrorSeparator()
public void renderHead(org.apache.wicket.Component component, org.apache.wicket.markup.head.IHeaderResponse response)
renderHead
in interface org.apache.wicket.markup.html.IComponentAwareHeaderContributor
renderHead
in class org.apache.wicket.ajax.AjaxEventBehavior
response
- Copyright © 2015. All rights reserved.