A generic Drag&Drop framework for Wicket:
operate on any markup element via selectors drag and drop between any Wicket components vertical, horizontal and hierarchical structured markup (i.e. trees)
... [More]
drag initiators (a.k.a. handles) common desktop metaphors with 'MOVE', 'COPY' and 'LINK' operations transfer types themeable works in Firefox, Safari, Chrome, IE and Opera See our live examples on http://wicket-dnd.appspot.com/ (beware - very slow!).
Theme your DnDAdd a theme to your pages to be used for DnD, e.g. the WindowsTheme:
add(CSSPackageResource.getHeaderContribution(new WindowsTheme()));Drag sourceAdd a DragSource behavior to enable a container for drags:
container.add(new DragSource(Operation.MOVE) {
public void onAfterDrop(AjaxRequestTarget target, Transfer transfer) {
// remove transfer data
}
}.drag("tr"));In this example only a MOVE operation is allowed. Drags are initiated on tags.
Drop targetAdd a DropTarget behavior to enable a container for drops:
container.add(new DropTarget(Operation.MOVE, Operation.COPY) {
public void onDrop(AjaxRequestTarget target, Transfer transfer, Location location) {
// add transfer data
}
}.dropCenter("tr"));In this example MOVE and COPY operations are allowed. Drops are performed on center of tags, the Location holds a reference to the actual component the transfer was dropped on. [Less]