Author: lgiessmann Date: Tue Sep 13 00:10:27 2011 New Revision: 879
Log: gdl-frontend: Widgets: changed the behavior of the delete-callback => if a topic is deleted on the server-side, it is also deleted for the topic map on the client side
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/DeleteCallback.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/DeleteCallback.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/DeleteCallback.java Tue Sep 13 00:01:58 2011 (r878) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/DeleteCallback.java Tue Sep 13 00:10:27 2011 (r879) @@ -54,7 +54,7 @@ builder.setHeader("Content-type", "application/json"); //RootPanel.getBodyElement().setInnerText(delObj.toString()); // TODO: remove - builder.sendRequest(delObj.toString(), new DeleteRequest(delObj)); + builder.sendRequest(delObj.toString(), new DeleteRequest(delObj, env)); }catch(RequestException e){ Window.alert("could not delete the topic: " + psi + ", because(" + e.getClass() + "): " + e.getMessage()); }catch(ExporterException e){ @@ -68,14 +68,16 @@ private class DeleteRequest implements RequestCallback { private JSONObject objectToBeSend = null; + private Topic topicToBeDeleted = null; @SuppressWarnings("unused") private DeleteRequest(){} - public DeleteRequest(JSONObject objectToBeDeleted){ + public DeleteRequest(JSONObject objectToBeDeleted, Topic topicToBeDeleted){ this.objectToBeSend = objectToBeDeleted; + this.topicToBeDeleted = topicToBeDeleted; } @@ -83,6 +85,7 @@ public void onResponseReceived(Request request, Response response) { if (200 == response.getStatusCode()) { Window.alert("delete operation of the object " + this.objectToBeSend + " succeeded"); + this.topicToBeDeleted.remove(); // TODO: reset the web page } else { Window.alert("delete operation of the object " + this.objectToBeSend + " failed: " + response.getStatusCode() + "(" + response.getStatusText() + ")\n" + response.getText());