[seam-commits] Seam SVN: r11919 - in modules/remoting/trunk: src/main/resources/org/jboss/seam/remoting and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Jan 6 22:28:28 EST 2010


Author: shane.bryzak at jboss.com
Date: 2010-01-06 22:28:27 -0500 (Wed, 06 Jan 2010)
New Revision: 11919

Modified:
   modules/remoting/trunk/examples/model/src/main/webapp/model.html
   modules/remoting/trunk/src/main/resources/org/jboss/seam/remoting/remote.js
Log:
fix model delta marshalling issue


Modified: modules/remoting/trunk/examples/model/src/main/webapp/model.html
===================================================================
--- modules/remoting/trunk/examples/model/src/main/webapp/model.html	2010-01-07 02:37:42 UTC (rev 11918)
+++ modules/remoting/trunk/examples/model/src/main/webapp/model.html	2010-01-07 03:28:27 UTC (rev 11919)
@@ -12,7 +12,7 @@
 
   <h1>Seam Remoting - Model Example</h1>
   
-  <script type="text/javascript" src="seam/resource/remoting/resource/remote.js?compress=true"></script>
+  <script type="text/javascript" src="seam/resource/remoting/resource/remote.js"></script>
   <script type="text/javascript" src="seam/resource/remoting/interface.js?personSearch"></script>
   
   <script type="text/javascript">    
@@ -130,6 +130,24 @@
       model.applyUpdates(); 
     }
     
+    function createDeleteAddressLink(address, div) {
+      var link = document.createElement("a");
+      link.href = "#";
+      link.onclick = function() {
+        var addresses = model.getValue("person").addresses;
+        for (var i = 0; i < addresses.length; i++) {
+          if (addresses[i] == address) {
+            addresses.splice(i, 1);
+            break;
+          }
+        };
+        
+        document.getElementById("addresses").removeChild(div);
+      };
+      link.appendChild(document.createTextNode("Delete address"));
+      return link; 
+    }
+    
     function createAddressEditor(address) {
       var addressDiv = document.createElement("div");
       addressDiv.className = "addressContainer";
@@ -152,6 +170,7 @@
       
       row3.appendChild(createLabel("Country"));
       row3.appendChild(createBoundInput(address, "country"));
+      row3.appendChild(createDeleteAddressLink(address, addressDiv));
      
       return addressDiv; 
     }

Modified: modules/remoting/trunk/src/main/resources/org/jboss/seam/remoting/remote.js
===================================================================
--- modules/remoting/trunk/src/main/resources/org/jboss/seam/remoting/remote.js	2010-01-07 02:37:42 UTC (rev 11918)
+++ modules/remoting/trunk/src/main/resources/org/jboss/seam/remoting/remote.js	2010-01-07 03:28:27 UTC (rev 11919)
@@ -911,7 +911,7 @@
   Seam.Delta.prototype.buildRefs = function() {
     var refs = [];
     for (var i=0; i<this.refs.elements.length; i++) {
-      refs.push(this.refs.elements[i]);
+      if (this.refs.elements[i].value) refs.push(this.refs.elements[i]);
     }
     return refs;
   };
@@ -1077,7 +1077,7 @@
         if (v instanceof Seam.Changeset) {
           for (var j=0; j<v.propertyChange.elements.length; j++) {
             d += "<member name=\"" + v.propertyChange.elements[j].key + "\">";
-            d += Seam.serializeValue(v.propertyChange.elements[j].value, null, refs);
+            d += Seam.serializeValue(v.propertyChange.elements[j].value, null, this.workingRefs);
             d += "</member>";
           }
         } else {



More information about the seam-commits mailing list