You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2014/10/29 19:16:10 UTC

[15/23] git commit: [flex-asjs] [refs/heads/develop] - teach generic binding to handle deferred instances

teach generic binding to handle deferred instances


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

Branch: refs/heads/develop
Commit: 85da2f03a6a5a694bb385591afacd0b5563fe16d
Parents: 494abd0
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 29 10:24:24 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Oct 29 11:15:43 2014 -0700

----------------------------------------------------------------------
 .../src/org/apache/flex/binding/GenericBinding.as      | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/85da2f03/frameworks/as/projects/FlexJSUI/src/org/apache/flex/binding/GenericBinding.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/binding/GenericBinding.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/binding/GenericBinding.as
index 0c74bf9..42ba6b9 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/binding/GenericBinding.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/binding/GenericBinding.as
@@ -23,7 +23,8 @@ package org.apache.flex.binding
 	import org.apache.flex.core.IBead;
 	import org.apache.flex.core.IDocument;
 	import org.apache.flex.core.IStrand;
-
+	import org.apache.flex.events.ValueChangeEvent;
+    
     /**
      *  The GenericBinding class is the data-binding class that applies
      *  changes to properties of source objects to a property of the
@@ -173,7 +174,11 @@ package org.apache.flex.binding
                 var n:int = arr.length;
                 var obj:Object = document[arr[0]];
                 if (obj == null)
+                {
+                    document.addEventListener(ValueChangeEvent.VALUE_CHANGE,
+                        destinationChangeHandler);
                     return;
+                }
                 for (var i:int = 1; i < n - 1; i++)
                 {
                     obj = obj[arr[i]];
@@ -219,5 +224,11 @@ package org.apache.flex.binding
             {
             }
 		}
+        
+        private function destinationChangeHandler(event:ValueChangeEvent):void
+        {
+            if (event.propertyName == destinationData[0])
+                valueChanged(null);
+        }
 	}
 }
\ No newline at end of file