From: Charles du Jeu Date: Tue, 22 Jun 2010 07:45:56 +0000 (+0000) Subject: Fix 293 & 291 X-Git-Tag: argeo-slc-2.1.7~1276 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=7b72702ce6e632fd98adb106f01a21fca4dd18c0;p=gpl%2Fargeo-slc.git Fix 293 & 291 git-svn-id: https://svn.argeo.org/slc/trunk@3616 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 613d927d4..e0816ffce 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 @@ -272,7 +272,9 @@ qx.Class.define("org.argeo.slc.web.TestList", request.addListener("completed", function(response){ if(this.getCurrentOpenInstanceId() == "test:"+testUuid){ var appletView = org.argeo.ria.components.ViewsManager.getInstance().getViewPaneById("applet"); - appletView.closeCurrent(); + if(appletView.contentExists(this.getCurrentOpenInstanceId())){ + appletView.closeCurrent(); + } this.setCurrentOpenInstanceId(null); } this.loadCollections(); diff --git a/server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/CellEditorFactory.js b/server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/CellEditorFactory.js index c82705167..7e31b7967 100644 --- a/server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/CellEditorFactory.js +++ b/server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/CellEditorFactory.js @@ -119,7 +119,9 @@ qx.Class.define("org.argeo.slc.ria.execution.CellEditorFactory", value = ""; } if(value == ""){ - cellEditor.add(new qx.ui.form.ListItem("", null, "__empty__")); + var li = new qx.ui.form.ListItem(""); + li.setModel("__empty__"); + cellEditor.add(li); } var list = metaData.refList; if (list) @@ -131,21 +133,23 @@ qx.Class.define("org.argeo.slc.ria.execution.CellEditorFactory", var row = list[i]; if ( row instanceof Array ) { // Array [key, description] where description can be null - item = new qx.ui.form.ListItem(row[0], null, row[0]); + item = new qx.ui.form.ListItem(row[0]); + item.setModel(row[0]); if(row[1]){ item.setToolTip(new qx.ui.tooltip.ToolTip(row[1])); } } else { - item = new qx.ui.form.ListItem(row, null, row) - } - if(value == item.getValue()){ - cellEditor.setSelected(item); + item = new qx.ui.form.ListItem(row); + item.setModel(row); } cellEditor.add(item); + if(value == item.getModel()){ + cellEditor.setSelection([item]); + } }; } - cellEditor.setValue("" + value); + cellEditor.setModelSelection(["" + value]); cellEditor.addListener("appear", function() { cellEditor.open(); }); @@ -156,7 +160,13 @@ qx.Class.define("org.argeo.slc.ria.execution.CellEditorFactory", // interface implementation getCellEditorValue : function(cellEditor) { - var value = cellEditor.getValue(); + var value; + if(cellEditor.classname == "qx.ui.form.TextField"){ + value = cellEditor.getValue(); + }else{ + var sel = cellEditor.getModelSelection(); + value = sel[0]; + } var validationFunc = cellEditor.getUserData("validationFunc"); // validation function will be called with new and old value