Explanation
I'm creating an application which let's you initially have 1 droptarget, and the items you insert could also be droptargets.
All items inserted in the mainPanel can be move around in the same way as the flexTable example in the gwt-dnd samples. Also all items can be removed, and if the removed item was a droptarget, it will delete all it's childrens.
Here's the code of the delete method:
innerDragController.unregisterDropController (propertiesWidget .getFlexTable().getRowController ());
innerDragController.unregisterDropController (propertiesWidget .getFlexTable().getColumnController ());
outerDragController.unregisterDropController (propertiesWidget .getFlexTable().getRowController ());
outerDragController.unregisterDropController (propertiesWidget .getFlexTable().getColumnController ());
propertiesWidget.getFlexTable(). setRowController(null);
propertiesWidget.getFlexTable(). setColumnController(null);
propertiesWidget.deleteChildWidgets ();
if (propertiesWidget.getRelatedTable ().getName().equals("HPanel" )) {
FlexTableUtil.removeColumnWhereWidgetExist (propertiesWidget.getRelatedTable ().getMainTable(), propertiesWidget);
} else if (propertiesWidget.getRelatedTable ().getName().equals("VPanel" )){
FlexTableUtil.removeRowWhereWidgetExist (propertiesWidget.getRelatedTable ().getMainTable(), propertiesWidget);}
public void deleteChildWidgets() {
if (flexTable != null) {
List<Widget> childs = flexTable.getChilds();
for (Widget child : childs) {
System.out.println("Removed: " + child.getNamingLabel().getText());
child.deleteChildWidgets();
if (flexTable.getName().equals("HPanel" )) {
FlexTableUtil.removeColumnWhereWidgetExist (flexTable.getMainTable (), child);
} else if (flexTable.getName().equals("VPanel" )){
FlexTableUtil.removeRowWhereWidgetExist (flexTable.getMainTable (), child);
}
child.removeFromParent();
innerDragController.makeNotDraggable (child);
outerDragController.makeNotDraggable (child);
child = null;
}
innerDragController.unregisterDropController (flexTable.getRowController ());
innerDragController.unregisterDropController (flexTable.getColumnController ());
outerDragController.unregisterDropController (flexTable.getRowController ());
outerDragController.unregisterDropController (flexTable.getColumnController ());
flexTable.setRowController(null );
flexTable.setColumnController(null );
innerDragController.makeNotDraggable (this);
flexTable = null;
}
}
Problem
The problem occur when after deleting one droptarget and then trying to move the already inserted items between other droptargets, or arraging the other in the existing droptarget. It gives me the error " Caused by: java.lang.
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/JfIiKr_6nvsJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment