Example usage for org.apache.wicket Component getOutputMarkupId

List of usage examples for org.apache.wicket Component getOutputMarkupId

Introduction

In this page you can find the example usage for org.apache.wicket Component getOutputMarkupId.

Prototype

public final boolean getOutputMarkupId() 

Source Link

Document

Gets whether or not component will output id attribute into the markup.

Usage

From source file:org.cast.cwm.data.component.DisablingAjaxCallListener.java

License:Open Source License

private String generateSelector(Component component) {
    if (selector == null) {
        if (component instanceof IDisablingComponent) {
            Collection<? extends Component> blockedComponents = ((IDisablingComponent) component)
                    .getComponents();/*from w  w  w .j  a  va 2 s . c o m*/
            StringBuffer buffer = new StringBuffer();
            for (Component c : blockedComponents) {
                if (!c.getOutputMarkupId())
                    throw new IllegalArgumentException("Disabled components must have a markup ID");
                buffer.append("#" + c.getMarkupId() + ", ");
            }
            if (buffer.length() > 0)
                buffer.deleteCharAt(buffer.lastIndexOf(","));
            selector = buffer.toString().trim();
        } else {
            throw new IllegalStateException(
                    "This listener should only be attached to components that implement IDisablingComponent");
        }
    }
    return selector;
}

From source file:org.dcm4chee.web.common.markup.BaseForm.java

License:LGPL

public static void addFormComponentsToAjaxRequestTarget(final AjaxRequestTarget target,
        final MarkupContainer form) {
    IVisitor<Component> visitor = new IVisitor<Component>() {

        public Object component(Component c) {
            if (c.getOutputMarkupId()) {
                target.addComponent(c);//from   w  w  w  .  ja  va2s.c  o m
            }
            return IVisitor.CONTINUE_TRAVERSAL;
        }
    };
    form.visitChildren(visitor);
}

From source file:org.dcm4chee.web.war.common.UIDFieldBehavior.java

License:LGPL

private void addToTarget(final AjaxRequestTarget target) {
    final String excludeId = getComponent().getId();
    IVisitor<Component> visitor = new IVisitor<Component>() {
        public Object component(Component c) {
            if (c instanceof FormComponent<?> && c.getOutputMarkupId() && !c.getId().equals(excludeId)) {
                target.addComponent(c);/*from   ww w  .  j  a  v  a 2 s . c om*/
            }
            return IVisitor.CONTINUE_TRAVERSAL;
        }
    };
    form.visitChildren(visitor);
}

From source file:org.dcm4chee.wizard.common.component.ExtendedForm.java

License:LGPL

public static void addFormComponentsToAjaxRequestTarget(final AjaxRequestTarget target, final Form<?> form) {

    form.visitChildren(new IVisitor<Component, Void>() {

        public void component(Component component, IVisit<Void> visit) {
            if (component.getOutputMarkupId())
                target.add(component);//from ww w  . j  av  a 2 s  .  c  om
        }
    });
}

From source file:org.hippoecm.frontend.dialog.AbstractDialog.java

License:Apache License

public Component setFocus(Component c) {
    if (focusComponent != null) {
        return c;
    }/*from  w w w  .j a  va2s.c om*/

    if (!c.getOutputMarkupId()) {
        c.setOutputMarkupId(true);
    }
    return focusComponent = c;
}

From source file:org.wicketopia.listener.ajax.AutoFeedbackListener.java

License:Apache License

@Override
public void onBeforeRespond(Map<String, Component> map, final AjaxRequestTarget target) {
    target.getPage().visitChildren(IFeedback.class, new IVisitor<Component, Void>() {
        @Override/* w w  w  . ja v  a  2s  .co  m*/
        public void component(Component component, IVisit<Void> visit) {
            if (component.getOutputMarkupId()) {
                target.add(component);
            }
            visit.dontGoDeeper();
        }
    });

}

From source file:sf.wicklet.gwt.server.ajax.impl.GwtAjaxWickletTarget.java

License:Apache License

@Override
public void add(final Component... components) {
    for (final Component component : components) {
        Args.notNull(component, "component");
        if (component.getOutputMarkupId() == false && !(component instanceof Page)) {
            throw new IllegalArgumentException(
                    "cannot update component that does not have setOutputMarkupId property set to true. Component: "
                            + component.toString());
        }//w ww  .  j av a 2  s  . c om
        add(component, component.getMarkupId());
    }
}