Example usage for org.apache.wicket.markup.html.form Form getBehaviors

List of usage examples for org.apache.wicket.markup.html.form Form getBehaviors

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html.form Form getBehaviors.

Prototype

public <M extends Behavior> List<M> getBehaviors(Class<M> type) 

Source Link

Document

Gets the subset of the currently coupled Behavior s that are of the provided type as an unmodifiable list.

Usage

From source file:com.evolveum.midpoint.web.component.prism.PrismValuePanel.java

License:Apache License

private DateValidator getActivationRangeValidator(Form form, ItemPath path) {
    DateValidator validator = null;//from   w ww .  j av a 2  s .com
    List<DateValidator> validators = form.getBehaviors(DateValidator.class);
    if (validators != null) {
        for (DateValidator val : validators) {
            if (path.equals(val.getIdentifier())) {
                validator = val;
                break;
            }
        }
    }

    if (validator == null) {
        validator = new DateValidator();
        validator.setIdentifier(path);
        form.add(validator);
    }

    return validator;
}