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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s