Class FormValidatorAdapter
- java.lang.Object
-
- org.apache.wicket.behavior.Behavior
-
- org.apache.wicket.markup.html.form.validation.FormValidatorAdapter
-
- All Implemented Interfaces:
java.io.Serializable,IComponentAwareEventSink,IFormValidator,IComponentAwareHeaderContributor,org.apache.wicket.util.io.IClusterable
public class FormValidatorAdapter extends Behavior implements IFormValidator
AdaptsIFormValidatortoBehavior- Author:
- igor
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FormValidatorAdapter(IFormValidator validator)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FormComponent<?>[]getDependentFormComponents()IFormValidatorgetValidator()voidvalidate(Form<?> form)This method is ran if all components returned byIFormValidator.getDependentFormComponents()are valid.-
Methods inherited from class org.apache.wicket.behavior.Behavior
afterRender, beforeRender, bind, canCallListener, detach, getStatelessHint, isEnabled, isTemporary, onAttribute, onComponentTag, onConfigure, onEvent, onException, onRemove, onTag, renderHead, unbind
-
-
-
-
Constructor Detail
-
FormValidatorAdapter
public FormValidatorAdapter(IFormValidator validator)
Constructor- Parameters:
validator-
-
-
Method Detail
-
getDependentFormComponents
public FormComponent<?>[] getDependentFormComponents()
- Specified by:
getDependentFormComponentsin interfaceIFormValidator- Returns:
- array of
FormComponents that this validator depends on
-
validate
public void validate(Form<?> form)
This method is ran if all components returned byIFormValidator.getDependentFormComponents()are valid.To report validation error use
FormComponent.error(org.apache.wicket.validation.IValidationError)by using any of the dependent form components or extend from AbstractFormValidator and use itsAbstractFormValidator.error(FormComponent, String, java.util.Map)method.- Specified by:
validatein interfaceIFormValidator- Parameters:
form- form this validator is added to
-
getValidator
public IFormValidator getValidator()
- Returns:
- form validator
-
-