Class FormValidatorAdapter
- java.lang.Object
-
- org.apache.wicket.behavior.Behavior
-
- org.apache.wicket.markup.html.form.validation.FormValidatorAdapter
-
- All Implemented Interfaces:
Serializable
,IComponentAwareEventSink
,IFormValidator
,IComponentAwareHeaderContributor
,IClusterable
public class FormValidatorAdapter extends Behavior implements IFormValidator
AdaptsIFormValidator
toBehavior
- 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()
IFormValidator
getValidator()
void
validate(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:
getDependentFormComponents
in interfaceIFormValidator
- Returns:
- array of
FormComponent
s 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:
validate
in interfaceIFormValidator
- Parameters:
form
- form this validator is added to
-
getValidator
public IFormValidator getValidator()
- Returns:
- form validator
-
-