Example usage for org.apache.wicket MarkupContainer getRenderBodyOnly

List of usage examples for org.apache.wicket MarkupContainer getRenderBodyOnly

Introduction

In this page you can find the example usage for org.apache.wicket MarkupContainer getRenderBodyOnly.

Prototype

public final boolean getRenderBodyOnly() 

Source Link

Document

If false the component's tag will be printed as well as its body (which is default).

Usage

From source file:com.googlecode.wicketwebbeans.containers.BeanForm.java

License:Apache License

private void refreshComponent(final AjaxRequestTarget target, Component targetComponent) {
    // Refresh this field. We have to find the parent Field to do this.
    MarkupContainer field;
    if (targetComponent instanceof Field) {
        field = (MarkupContainer) targetComponent;
    } else {//from  w  w w.jav a  2 s  .  co  m
        field = targetComponent.findParent(AbstractField.class);
    }

    if (field != null) {
        if (!field.getRenderBodyOnly()) {
            target.addComponent(field);
        } else {
            // Field is RenderBodyOnly, have to add children individually
            field.visitChildren(new IVisitor<Component>() {
                public Object component(Component component) {
                    if (!component.getRenderBodyOnly()) {
                        target.addComponent(component);
                    }

                    return IVisitor.CONTINUE_TRAVERSAL;
                }

            });
        }
    } else {
        target.addComponent(targetComponent);
    }
}