This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 726a3b4  Fix DataBindingBase.deferredBindings supporting only a single 
(last) property
     new 7e47432  Merge pull request #1024 from 
stanislaw89/bug/deferred-bindings-multiple-properties
726a3b4 is described below

commit 726a3b4498529da9439852542d81c5c7dbcb1808
Author: sten <[email protected]>
AuthorDate: Wed Dec 30 21:06:19 2020 -0500

    Fix DataBindingBase.deferredBindings supporting only a single (last) 
property
---
 .../org/apache/royale/binding/DataBindingBase.as   | 30 ++++++++++++++++------
 1 file changed, 22 insertions(+), 8 deletions(-)

diff --git 
a/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/DataBindingBase.as
 
b/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/DataBindingBase.as
index 832b73b..2adf3bb 100644
--- 
a/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/DataBindingBase.as
+++ 
b/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/DataBindingBase.as
@@ -171,11 +171,17 @@ package org.apache.royale.binding
                                                deferredBindings = {};
                                                
IEventDispatcher(_strand).addEventListener("valueChange", 
deferredBindingsHandler);
                     }
-                    deferredBindings[bindingObject.destination[0]] = binding;
+                    var propertyBindings:Array = 
deferredBindings[bindingObject.destination[0]];
+                    if (!propertyBindings)
+                    {
+                        propertyBindings = [];
+                        deferredBindings[bindingObject.destination[0]] = 
propertyBindings;
+                    }
+                    propertyBindings.push(binding);
                 }
             }
         }
-        
+
         private function watcherChildrenRelevantToIndex(children:Object, 
index:int):Boolean{
             var watchers:Array = children ? children.watchers : null;
                        var hasValidWatcherChild:Boolean = false;
@@ -276,7 +282,7 @@ package org.apache.royale.binding
                         {
                             pw.parentChanged(parentObj);
                         }
-    
+
                         if (parentWatcher)
                         {
                             parentWatcher.addChild(pw);
@@ -286,7 +292,7 @@ package org.apache.royale.binding
                             pw.addBinding(gb);
                         }
                     }
-                    
+
                     if (hasWatcherChildren)
                     {
                         setupWatchers(gb, index, watcher.children.watchers, 
watcher.watcher);
@@ -310,7 +316,7 @@ package org.apache.royale.binding
         }
 
                private function watcherChildIsXML(watcher:Object):Boolean
-               {       
+               {
                        return (watcher.children.watchers.length == 1 && 
watcher.children.watchers[0].type == "xml");
                }
 
@@ -425,18 +431,26 @@ package org.apache.royale.binding
             {
                 if (_strand[p] != null)
                 {
+                    var propertyBindings:Array = deferredBindings[p];
+
                     var destination:IStrand = _strand[p] as IStrand;
                     if (destination)
                     {
-                        destination.addBead(deferredBindings[p]);
+                        for each (var bindingBead:IBead in propertyBindings)
+                        {
+                            destination.addBead(bindingBead);
+                        }
                     }
                     else
                     {
                         var destObject:Object = _strand[p];
                         if (destObject)
                         {
-                            deferredBindings[p].destination = destObject;
-                            _strand.addBead(deferredBindings[p]);
+                            for each (var binding:IBinding in propertyBindings)
+                            {
+                                binding.destination = destObject;
+                                _strand.addBead(IBead(binding));
+                            }
                         }
                         else
                         {

Reply via email to