flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [3/6] git commit: [flex-asjs] [refs/heads/develop] - sync up with container databinding
Date Fri, 08 May 2015 06:14:38 GMT
sync up with container databinding


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/5729bbe9
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/5729bbe9
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/5729bbe9

Branch: refs/heads/develop
Commit: 5729bbe99ac9de0c286575262fae277c57ff4a4d
Parents: 32dd968
Author: Alex Harui <aharui@apache.org>
Authored: Tue May 5 11:54:52 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu May 7 17:36:08 2015 -0700

----------------------------------------------------------------------
 .../apache/flex/binding/ViewBaseDataBinding.as  | 46 ++++++++++++++++----
 1 file changed, 37 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5729bbe9/frameworks/projects/Binding/as/src/org/apache/flex/binding/ViewBaseDataBinding.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Binding/as/src/org/apache/flex/binding/ViewBaseDataBinding.as
b/frameworks/projects/Binding/as/src/org/apache/flex/binding/ViewBaseDataBinding.as
index 960b2b5..88c580a 100644
--- a/frameworks/projects/Binding/as/src/org/apache/flex/binding/ViewBaseDataBinding.as
+++ b/frameworks/projects/Binding/as/src/org/apache/flex/binding/ViewBaseDataBinding.as
@@ -79,6 +79,7 @@ package org.apache.flex.binding
             if (!("_bindings" in _strand))
                 return;
             var bindingData:Array = _strand["_bindings"];
+            var destObject:Object;
             var n:int = bindingData[0];
             var bindings:Array = [];
             var i:int;
@@ -113,13 +114,22 @@ package org.apache.flex.binding
                                 sb.sourceID = binding.source[0];
                                 sb.sourcePropertyName = binding.source[1];
                                 sb.setDocument(_strand);
-                                destination = _strand[binding.destination[0]] as IStrand;
+                                destObject = _strand[binding.destination[0]];           
                    
+                                destination = destObject as IStrand;
                                 if (destination)
                                     destination.addBead(sb);
                                 else
                                 {
-                                    deferredBindings[binding.destination[0]] = sb;
-                                    IEventDispatcher(_strand).addEventListener("valueChange",
deferredBindingsHandler);
+                                    if (destObject)
+                                    {
+                                        sb.destination = destObject;
+                                        _strand.addBead(sb);
+                                    }
+                                    else
+                                    {
+                                        deferredBindings[binding.destination[0]] = sb;
+                                        IEventDispatcher(_strand).addEventListener("valueChange",
deferredBindingsHandler);
+                                    }
                                 }
                             }
                             else if (fieldWatcher.eventNames == null)
@@ -129,13 +139,22 @@ package org.apache.flex.binding
                                 cb.sourceID = binding.source[0];
                                 cb.sourcePropertyName = binding.source[1];
                                 cb.setDocument(_strand);
-                                destination = _strand[binding.destination[0]] as IStrand;
+                                destObject = _strand[binding.destination[0]];           
                    
+                                destination = destObject as IStrand;
                                 if (destination)
                                     destination.addBead(cb);
                                 else
                                 {
-                                    deferredBindings[binding.destination[0]] = cb;
-                                    IEventDispatcher(_strand).addEventListener("valueChange",
deferredBindingsHandler);
+                                    if (destObject)
+                                    {
+                                        sb.destination = destObject;
+                                        _strand.addBead(sb);
+                                    }
+                                    else
+                                    {
+                                        deferredBindings[binding.destination[0]] = sb;
+                                        IEventDispatcher(_strand).addEventListener("valueChange",
deferredBindingsHandler);
+                                    }
                                 }
                             }
                         }
@@ -151,13 +170,22 @@ package org.apache.flex.binding
                         sb.eventName = fieldWatcher.eventNames as String;
                         sb.sourcePropertyName = binding.source;
                         sb.setDocument(_strand);
-                        destination = _strand[binding.destination[0]] as IStrand;
+                        destObject = _strand[binding.destination[0]];                   
            
+                        destination = destObject as IStrand;
                         if (destination)
                             destination.addBead(sb);
                         else
                         {
-                            deferredBindings[binding.destination[0]] = sb;
-                            IEventDispatcher(_strand).addEventListener("valueChange", deferredBindingsHandler);
+                            if (destObject)
+                            {
+                                sb.destination = destObject;
+                                _strand.addBead(sb);
+                            }
+                            else
+                            {
+                                deferredBindings[binding.destination[0]] = sb;
+                                IEventDispatcher(_strand).addEventListener("valueChange",
deferredBindingsHandler);
+                            }
                         }
                     }
                 }


Mime
View raw message