You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2017/10/24 10:18:38 UTC

[GitHub] justinmclean opened a new issue #46: ViewDataBinding not working as expected

justinmclean opened a new issue #46: ViewDataBinding not working as expected
URL: https://github.com/apache/royale-asjs/issues/46
 
 
   This flex SDK code:
   ```
   <?xml version="1.0" encoding="utf-8"?>
   <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
   			   xmlns:s="library://ns.adobe.com/flex/spark" 
   			   xmlns:mx="library://ns.adobe.com/flex/mx"
   			   applicationComplete="init()">
   
   	<s:layout>
   		<s:VerticalLayout />
   	</s:layout>
   	
   	<fx:Script>
   		<![CDATA[
   		[Bindable] public var obj:Object;
   
           public function init():void {
               obj = {text:"Hello World"};
           }
   		]]>
   	</fx:Script>
       
   	<mx:Label text="{obj.text}" />
   
   </s:Application>
   ```
   
   Generates a warning re binding but still display "Hello World" as expected as the entire object is replaced.
   
   The similar RoyaleJS code also generate a binding warning but fails to display "Hello World".
   
   ```
   <?xml version="1.0" encoding="utf-8"?>
   <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:js="library://ns.apache.org/royale/basic"
                   xmlns:local="*" applicationComplete="init()">
   
       <js:valuesImpl>
           <js:SimpleCSSValuesImpl/>
       </js:valuesImpl>
   
       <fx:Script><![CDATA[
   
           [Bindable] public var obj:Object;
   
           public function init():void {
               obj = {text:"Hello World"};
           }
           ]]></fx:Script>
       
       <js:initialView>
           <js:View percentWidth="100" percentHeight="100">
               <js:beads>
                   <js:ViewDataBinding/>
               </js:beads>
               <js:Label text="{obj.text}" />
           </js:View>
       </js:initialView>
   
   </js:Application>
   ```
   
   I can see that the binding event is being dispatched when the obj assignment is executed.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services