Examples of SortableList


Examples of org.wicketstuff.yui.markup.html.sortable.SortableList

    final Label serverState = new Label("serverState", new PropertyModel(this, "choices"));
    serverState.setOutputMarkupId(true);
    add(serverState);

    SortableList container = new SortableList("sortableList")
    {
      @Override
      protected void onDrop(AjaxRequestTarget target, Component component, int index)
      {
        Component label = ((MarkupContainer) component).get("label");
        String value = label.getDefaultModelObjectAsString();
        choices.remove(value);
        choices.add(index, value);
        target.addComponent(serverState);
      }
    };
    add(container);

    RepeatingView view = new RepeatingView("sortableItem");
    List<String> list = choices;
    for (int a = 0; a < list.size(); a++) {
      SortableItem item = new SortableItem(view.newChildId());
      view.add(item);
      item.add(new Label("label", list.get(a)));
    }
    container.add(view);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.