]> source.dussan.org Git - vaadin-framework.git/commitdiff
changed underscores to pipes in parameter keys (now allows to have underscore in...
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 17 Dec 2007 13:46:43 +0000 (13:46 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 17 Dec 2007 13:46:43 +0000 (13:46 +0000)
svn changeset:3246/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java
src/com/itmill/toolkit/terminal/gwt/server/CommunicationManager.java

index a1a758903a19688f9cecfad8dc84d71ac2cab91d..fd0f2edea68faeb00ad9eff1e629763766a8f330 100755 (executable)
@@ -373,7 +373,7 @@ public class ApplicationConnection {
 
     private void addVariableToQueue(String paintableId, String variableName,
             String encodedValue, boolean immediate, char type) {
-        final String id = paintableId + "_" + variableName + "_" + type;
+        final String id = paintableId + "|" + variableName + "|" + type;
         for (int i = 0; i < pendingVariables.size(); i += 2) {
             if ((pendingVariables.get(i)).equals(id)) {
                 pendingVariables.remove(i);
index 6453318cef25c9ac40113cb24780de2ce1a943c4..d758c833b659bba1a2839d1203e61b5819f75588 100644 (file)
@@ -151,7 +151,7 @@ public class CommunicationManager implements Paintable.RepaintRequestListener,
                 if (item.isFormField()) {
                     // ignored, upload requests contian only files
                 } else {
-                    final String pid = name.split("_")[0];
+                    final String pid = name.split("|")[0];
                     final Upload uploadComponent = (Upload) idPaintableMap
                             .get(pid);
                     if (uploadComponent == null) {
@@ -457,15 +457,18 @@ public class CommunicationManager implements Paintable.RepaintRequestListener,
                 : params.get("changes"));
         params.remove("changes");
         if (changes != null) {
+            // keys are one paired indexes variable values on odd ones
             final String[] ca = changes.split("\u0001");
             for (int i = 0; i < ca.length; i++) {
-                String[] vid = ca[i].split("_");
+                // extract variable info from key of format
+                // "PID_variableName_type"
+                String[] vid = ca[i].split("\\|");
                 final VariableOwner owner = (VariableOwner) idPaintableMap
                         .get(vid[0]);
                 if (owner != null) {
                     Map m;
                     if (i + 2 >= ca.length
-                            || !vid[0].equals(ca[i + 2].split("_")[0])) {
+                            || !vid[0].equals(ca[i + 2].split("|")[0])) {
                         if (ca.length > i + 1) {
                             m = new SingleValueMap(vid[1],
                                     convertVariableValue(vid[2].charAt(0),
@@ -480,8 +483,8 @@ public class CommunicationManager implements Paintable.RepaintRequestListener,
                                 ca[++i]));
                     }
                     while (i + 1 < ca.length
-                            && vid[0].equals(ca[i + 1].split("_")[0])) {
-                        vid = ca[++i].split("_");
+                            && vid[0].equals(ca[i + 1].split("|")[0])) {
+                        vid = ca[++i].split("|");
                         m.put(vid[1], convertVariableValue(vid[2].charAt(0),
                                 ca[++i]));
                     }