From: Charles du Jeu Date: Sun, 20 Jun 2010 20:16:46 +0000 (+0000) Subject: Keep the current open test to close it if deleted. X-Git-Tag: argeo-slc-2.1.7~1279 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=5389c2428a149b1cf67554c580bd0651e2800525;p=gpl%2Fargeo-slc.git Keep the current open test to close it if deleted. git-svn-id: https://svn.argeo.org/slc/trunk@3611 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/server/org.argeo.slc.ria/src/argeo-ria-lib/slc-web/class/org/argeo/slc/web/TestList.js b/server/org.argeo.slc.ria/src/argeo-ria-lib/slc-web/class/org/argeo/slc/web/TestList.js index 31f97165d..613d927d4 100644 --- a/server/org.argeo.slc.ria/src/argeo-ria-lib/slc-web/class/org/argeo/slc/web/TestList.js +++ b/server/org.argeo.slc.ria/src/argeo-ria-lib/slc-web/class/org/argeo/slc/web/TestList.js @@ -61,6 +61,10 @@ qx.Class.define("org.argeo.slc.web.TestList", init : 'My Collection', check : "String" }, + currentOpenInstanceId : { + check : "String", + nullable:true + }, /** * The applet commands. */ @@ -130,6 +134,7 @@ qx.Class.define("org.argeo.slc.web.TestList", var classObj = org.argeo.slc.ria.Applet; var xmlNodes = viewsManager.getViewPaneSelection("list").getNodes(); var iView = viewsManager.initIViewClass(classObj, "applet", xmlNodes[0]); + this.setCurrentOpenInstanceId(iView.getInstanceId()); iView.load(xmlNodes[0]); }, selectionChange : function(viewId, xmlNodes){ @@ -260,10 +265,16 @@ qx.Class.define("org.argeo.slc.web.TestList", toolbar : "selection", callback : function(e){ var modal = new org.argeo.ria.components.Modal("Confirm", null); - modal.addConfirm("Are you sure you want to delete
test " + this.extractTestUuid() + "?"); + var testUuid = this.extractTestUuid(); + modal.addConfirm("Are you sure you want to delete
test " + testUuid + "?"); modal.addListener("ok", function(){ var request = org.argeo.slc.ria.SlcApi.getRemoveResultService(this.getCollectionId(), this.extractTestUuid()); request.addListener("completed", function(response){ + if(this.getCurrentOpenInstanceId() == "test:"+testUuid){ + var appletView = org.argeo.ria.components.ViewsManager.getInstance().getViewPaneById("applet"); + appletView.closeCurrent(); + this.setCurrentOpenInstanceId(null); + } this.loadCollections(); this.loadList(); this.info("Test was successfully deleted");