wicket : Drag and Drop

Latest wicket support drag n drop English: Drag and Drop Ltd Logo
here is the link
http://code.google.com/p/wicket-dnd/

here is the same code, simple define source and target 🙂

        WebMarkupContainer container = new WebMarkupContainer("container");
    Model<String> model = Model.of(new String("AAA"));
    container.add(new DragSource(Operation.values()) {
          public void onAfterDrop(AjaxRequestTarget target, Transfer transfer) {

              System.out.println("Drag n drop");

          }
        }.drag("span"));

    container.add(new DropTarget(Operation.values()) {
          public void onDrop(AjaxRequestTarget target, Transfer transfer, Location location) {
            // add transfer data

              System.out.println("rrrr");
          }
        }.dropCenter("td"));

    Label label = new Label("aaa", model);
    label.setOutputMarkupId(true);
    container.add(label);

    add(container);

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.