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

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

Introduction

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

Prototype

public boolean isEnabledInHierarchy() 

Source Link

Document

Calculates enabled state of the component taking its hierarchy into account.

Usage

From source file:de.alpharogroup.wicket.behaviors.models.UpdateModelVisitor.java

License:Apache License

/**
 * {@inheritDoc}//from  w  w w  .j  av  a2 s  .c  o m
 */
@Override
public void component(final FormComponent<?> formComponent, final IVisit<Void> visit) {
    if (formComponent instanceof IFormModelUpdateListener) {
        final Form<?> form = Form.findForm(formComponent);
        if (form != null) {
            if (this.form == null || this.form == form) {
                if (form.isEnabledInHierarchy()) {
                    if (formComponent.isVisibleInHierarchy() && formComponent.isEnabledInHierarchy()) {
                        formComponent.modelChanging();
                        ((IFormModelUpdateListener) formComponent).updateModel();
                        formComponent.modelChanged();
                    }
                }
            }
        }
    }
}

From source file:org.opensingular.form.wicket.component.SingularFormWicket.java

License:Apache License

protected void convertWithoutValidateComponents() {
    if (isEnabledInHierarchy() && isVisibleInHierarchy()) {
        visitFormComponentsPostOrder(new ValidationVisitor() {
            @Override/*from  w  w w  . j ava2 s .  c o  m*/
            public void validate(final FormComponent<?> formComponent) {
                final Form<?> form = formComponent.getForm();
                if ((!(form instanceof SingularFormWicket<?>) || (SingularFormWicket.this.equals(form)))
                        && form.isEnabledInHierarchy() && form.isVisibleInHierarchy()) {
                    formComponent.convertInput();
                }
            }
        });
    }
}