flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - fix binding to functions that don't have change events
Date Thu, 05 May 2016 06:35:30 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop 2646884b0 -> 38d40b6bb


fix binding to functions that don't have change events


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

Branch: refs/heads/develop
Commit: 38d40b6bb9cb90b1697a3b97fe17c815f5f0bf02
Parents: 2646884
Author: Alex Harui <aharui@apache.org>
Authored: Wed May 4 23:35:04 2016 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Wed May 4 23:35:14 2016 -0700

----------------------------------------------------------------------
 .../flex/org/apache/flex/binding/ApplicationDataBinding.as  | 9 +++++++++
 .../flex/org/apache/flex/binding/ContainerDataBinding.as    | 9 +++++++++
 .../org/apache/flex/binding/MXMLBeadViewBaseDataBinding.as  | 9 +++++++++
 .../flex/org/apache/flex/binding/ViewBaseDataBinding.as     | 9 +++++++++
 4 files changed, 36 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/38d40b6b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ApplicationDataBinding.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ApplicationDataBinding.as
b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ApplicationDataBinding.as
index 8d794b9..3902ebc 100644
--- a/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ApplicationDataBinding.as
+++ b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ApplicationDataBinding.as
@@ -214,6 +214,8 @@ package org.apache.flex.binding
         
         private function setupWatchers(gb:GenericBinding, index:int, watchers:Array, parentWatcher:WatcherBase):void
         {
+            var foundWatcher:Boolean = false;
+            
             var n:int = watchers.length;
             for (var i:int = 0; i < n; i++)
             {
@@ -243,6 +245,7 @@ package org.apache.flex.binding
                                 parentWatcher.addChild(pw);
                             if (watcher.children == null)
                                 pw.addBinding(gb);
+                            foundWatcher = true;
                             break;
                         }
                     }
@@ -252,6 +255,12 @@ package org.apache.flex.binding
                     }
                 }
             }
+            if (!foundWatcher && parentWatcher == null)
+            {
+                // might be a binding to a function that doesn't have change events
+                // so just force an update
+                gb.valueChanged(null);
+            }
         }
         
         private function decodeWatcher(bindingData:Array):Object

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/38d40b6b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ContainerDataBinding.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ContainerDataBinding.as
b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ContainerDataBinding.as
index 42c5178..106fe10 100644
--- a/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ContainerDataBinding.as
+++ b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ContainerDataBinding.as
@@ -260,6 +260,8 @@ package org.apache.flex.binding
         
         private function setupWatchers(gb:GenericBinding, index:int, watchers:Array, parentWatcher:WatcherBase):void
         {
+            var foundWatcher:Boolean = false;
+            
             var n:int = watchers.length;
             for (var i:int = 0; i < n; i++)
             {
@@ -289,6 +291,7 @@ package org.apache.flex.binding
                                 parentWatcher.addChild(pw);
                             if (watcher.children == null)
                                 pw.addBinding(gb);
+                            foundWatcher = true;
                             break;
                         }
                     }
@@ -298,6 +301,12 @@ package org.apache.flex.binding
                     }
                 }
             }
+            if (!foundWatcher && parentWatcher == null)
+            {
+                // might be a binding to a function that doesn't have change events
+                // so just force an update
+                gb.valueChanged(null);
+            }
         }
         
         private function decodeWatcher(bindingData:Array):Object

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/38d40b6b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/MXMLBeadViewBaseDataBinding.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/MXMLBeadViewBaseDataBinding.as
b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/MXMLBeadViewBaseDataBinding.as
index 5d35cea..803ce56 100644
--- a/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/MXMLBeadViewBaseDataBinding.as
+++ b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/MXMLBeadViewBaseDataBinding.as
@@ -209,6 +209,8 @@ package org.apache.flex.binding
         
         private function setupWatchers(gb:GenericBinding, index:int, watchers:Array, parentWatcher:WatcherBase):void
         {
+            var foundWatcher:Boolean = false;
+            
             var n:int = watchers.length;
             for (var i:int = 0; i < n; i++)
             {
@@ -238,6 +240,7 @@ package org.apache.flex.binding
                                 parentWatcher.addChild(pw);
                             if (watcher.children == null)
                                 pw.addBinding(gb);
+                            foundWatcher = true;
                             break;
                         }
                     }
@@ -247,6 +250,12 @@ package org.apache.flex.binding
                     }
                 }
             }
+            if (!foundWatcher && parentWatcher == null)
+            {
+                // might be a binding to a function that doesn't have change events
+                // so just force an update
+                gb.valueChanged(null);
+            }
         }
         
         private function decodeWatcher(bindingData:Array):Object

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/38d40b6b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ViewBaseDataBinding.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ViewBaseDataBinding.as
b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ViewBaseDataBinding.as
index 88c580a..6bfd5a2 100644
--- a/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ViewBaseDataBinding.as
+++ b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ViewBaseDataBinding.as
@@ -208,6 +208,8 @@ package org.apache.flex.binding
         
         private function setupWatchers(gb:GenericBinding, index:int, watchers:Array, parentWatcher:WatcherBase):void
         {
+            var foundWatcher:Boolean = false;
+            
             var n:int = watchers.length;
             for (var i:int = 0; i < n; i++)
             {
@@ -237,6 +239,7 @@ package org.apache.flex.binding
                                 parentWatcher.addChild(pw);
                             if (watcher.children == null)
                                 pw.addBinding(gb);
+                            foundWatcher = true;
                             break;
                         }
                     }
@@ -246,6 +249,12 @@ package org.apache.flex.binding
                     }
                 }
             }
+            if (!foundWatcher && parentWatcher == null)
+            {
+                // might be a binding to a function that doesn't have change events
+                // so just force an update
+                gb.valueChanged(null);
+            }
         }
         
         private function decodeWatcher(bindingData:Array):Object


Mime
View raw message