Example usage for org.apache.wicket Component setOutputMarkupId

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

Introduction

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

Prototype

public final Component setOutputMarkupId(final boolean output) 

Source Link

Document

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

Usage

From source file:wicketdnd.test.TestPage.java

License:Apache License

public TestPage(Operation... operations) {

    dragSource = new WebMarkupContainer("dragSource");
    dragSource.add(new DragSource(operations) {
        @Override//ww  w. j  av a2  s . com
        public void onBeforeDrop(Component drag, Transfer transfer) throws Reject {
            super.onBeforeDrop(drag, transfer);

            log.add("onBeforeDrop");
        }

        @Override
        public void onAfterDrop(AjaxRequestTarget target, Transfer transfer) {
            log.add("onAfterDrop");
        }
    });
    add(dragSource);

    drag = new WebMarkupContainer("drag");
    drag.setOutputMarkupId(true);
    dragSource.add(drag);

    dropTarget = new WebMarkupContainer("dropTarget");
    dropTarget.add(new DropTarget(operations) {
        @Override
        public void onDrag(AjaxRequestTarget target, Location location) {
            log.add("onDrag");
        }

        @Override
        public void onDrop(AjaxRequestTarget target, Transfer transfer, Location location) throws Reject {
            log.add("onDrop");
        }

        @Override
        public void onRejected(AjaxRequestTarget target) {
            log.add("onRejected");
        }
    });
    add(dropTarget);

    drop = new WebMarkupContainer("drop");
    drop.setOutputMarkupId(true);
    dropTarget.add(drop);
}