protected void event(UserRequest ureq, Controller source, Event event) {
if (source == treeCtr) {
// Catch move tree event. Here on the server side we can still prevent the
// move operation to happen...
if (event instanceof MoveTreeNodeEvent) {
MoveTreeNodeEvent moveEvent = (MoveTreeNodeEvent) event;
getWindowControl().setInfo("Node::" + moveEvent.getNodeId() + " moved to new parent::" + moveEvent.getNewParentNodeId() + " at position::" + moveEvent.getPosition());
// Set status: allow move or don't allow move. For this demo we just say yes...
// See also the js code in the guidemo-ajaxtree.html file!
moveEvent.setResult(true, null, null);
} else if (event instanceof TreeNodeClickedEvent) {
TreeNodeClickedEvent clickedEvent = (TreeNodeClickedEvent) event;
getWindowControl().setInfo("Node::" + clickedEvent.getNodeId() + " got clicked!");