You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2019/01/03 20:17:48 UTC

[royale-asjs] 02/02: Fix a binding bug with multiple event triggers

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

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

commit 20b32016b723a6f71e22454040e37ae9996d3814
Author: greg-dove <gr...@gmail.com>
AuthorDate: Fri Jan 4 09:17:20 2019 +1300

    Fix a binding bug with multiple event triggers
---
 .../TourDeJewel/src/main/royale/PopUpPlayGround.mxml    | 17 ++++++++---------
 .../org/apache/royale/binding/ContainerDataBinding.as   | 11 ++++++-----
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/examples/royale/TourDeJewel/src/main/royale/PopUpPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/PopUpPlayGround.mxml
index 2567d39..0c33d8a 100644
--- a/examples/royale/TourDeJewel/src/main/royale/PopUpPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/PopUpPlayGround.mxml
@@ -17,10 +17,10 @@ See the License for the specific language governing permissions and
 limitations under the License.
 
 -->
-<c:ExampleAndSourceCodeTabbedSectionContent xmlns:fx="http://ns.adobe.com/mxml/2009" 
-	xmlns:j="library://ns.apache.org/royale/jewel" 
-	xmlns:html="library://ns.apache.org/royale/html" 
-	xmlns:js="library://ns.apache.org/royale/basic" 
+<c:ExampleAndSourceCodeTabbedSectionContent xmlns:fx="http://ns.adobe.com/mxml/2009"
+	xmlns:j="library://ns.apache.org/royale/jewel"
+	xmlns:html="library://ns.apache.org/royale/html"
+	xmlns:js="library://ns.apache.org/royale/basic"
 	xmlns:c="components.*" sourceCodeUrl="PopUpPlayGround.mxml">
 
 	<fx:Script>
@@ -34,7 +34,6 @@ limitations under the License.
 		public function closePopUpHandler(event:Event):void
 		{
 			trace("[closePopUp] ", event.target, popup1.content);
-			check1.selected = false;
 		}
 		]]>
 	</fx:Script>
@@ -50,10 +49,10 @@ limitations under the License.
 
 				<!-- PopUp 1-->
 				<j:Label text="Click the button below to display a Modal PopUp"/>
-				<j:CheckBox localId="check1" text="open/close the popup: {popup1.open}" selected="{popup1.open}"/>
-				<j:PopUp id="popup1" className="somePopUpContent" modal="true" 
-							open="{check1.selected}" 
-							openPopUp="openPopUpHandler(event)" 
+				<j:CheckBox localId="check1" selected="{popup1.open}" text="open/close the popup: {popup1.open}" />
+				<j:PopUp id="popup1" className="somePopUpContent" modal="true"
+							open="{check1.selected}"
+							openPopUp="openPopUpHandler(event)"
 							closePopUp="closePopUpHandler(event)" />
 			</j:Card>
 		</j:GridCell>
diff --git a/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/ContainerDataBinding.as b/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/ContainerDataBinding.as
index e1e3c33..edc2600 100644
--- a/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/ContainerDataBinding.as
+++ b/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/ContainerDataBinding.as
@@ -39,7 +39,7 @@ package org.apache.royale.binding
      *  the different lifecycles.  For example, an item renderer
      *  databinding implementation can wait to execute databindings
      *  until the data property is set.
-     *  
+     *
      *  @langversion 3.0
      *  @playerversion Flash 10.2
      *  @playerversion AIR 2.6
@@ -49,7 +49,7 @@ package org.apache.royale.binding
 	{
         /**
          *  Constructor.
-         *  
+         *
          *  @langversion 3.0
          *  @playerversion Flash 10.2
          *  @playerversion AIR 2.6
@@ -126,6 +126,8 @@ package org.apache.royale.binding
                                 cb.setDocument(_strand);
 
                                 prepareCreatedBinding(cb as IBinding, binding);
+                            } else {
+                                makeGenericBinding(binding, i, watchers);
                             }
                         }
                         else
@@ -176,8 +178,7 @@ package org.apache.royale.binding
                         prepareCreatedBinding(sb as IBinding, binding);
                     }
                 }
-                else
-                {
+                else  {
                     makeGenericBinding(binding, i, watchers);
                 }
 
@@ -201,7 +202,7 @@ package org.apache.royale.binding
                 // should be a constant expression.
                 // the value doesn't matter as GenericBinding
                 // should get the value from the source
-                gb.valueChanged(null);  
+                gb.valueChanged(null);
             }
         }
     }