]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
Pass parameter directly encoded as "data", otherwise they will be appended to the...
authorCharles du Jeu <charles.dujeu@gmail.com>
Thu, 26 Feb 2009 18:23:52 +0000 (18:23 +0000)
committerCharles du Jeu <charles.dujeu@gmail.com>
Thu, 26 Feb 2009 18:23:52 +0000 (18:23 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@2186 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/remote/JmsClient.js

index eceaceff0c7585997672cb6e16df8fd1f167c5f2..63711e74b724420a9a454e8ea0e333d6826e0230 100644 (file)
@@ -135,14 +135,36 @@ qx.Class.define("org.argeo.ria.remote.JmsClient", {
                 */\r
                _sendMessage : function(destination, message, type, properties) {\r
                        var req = new qx.io.remote.Request(this.uri, "POST", "text/plain");\r
-                       req.setParameter("destination", destination);\r
-                       req.setParameter("message", message);\r
-                       req.setParameter("type", type);\r
-                       if(properties){\r
-                               for(var key in properties){\r
-                                       req.setParameter(key, properties[key]);\r
-                               }\r
-                       }\r
+                       if(!properties) properties = {};                        \r
+                       properties["destination"] = destination;\r
+                       properties["message"] = message;\r
+                       properties["type"] = type;\r
+               var vParametersList = [];\r
+       \r
+               for (var vId in properties)\r
+               {\r
+                 var value = properties[vId];\r
+                 if (value instanceof Array)\r
+                 {\r
+                   for (var i=0; i<value.length; i++)\r
+                   {\r
+                     vParametersList.push(encodeURIComponent(vId) +\r
+                                          "=" +\r
+                                          encodeURIComponent(value[i]));\r
+                   }\r
+                 }\r
+                 else\r
+                 {\r
+                   vParametersList.push(encodeURIComponent(vId) +\r
+                                        "=" +\r
+                                        encodeURIComponent(value));\r
+                 }\r
+               }       \r
+               if (vParametersList.length > 0)\r
+               {\r
+                 req.setData(vParametersList.join("&"));\r
+               }\r
+                       \r
                        //req.addListener("completed", this.endBatch, this);\r
                        req.send();\r
                },\r