Alex Harui wrote
> How are the three elements defined? IOW: what is anyClass, a variable, a
> getter/setter, a [Bindable]? What about subClass?
>
> Where there any warnings in the compiler output?
Here is an example code snippets that should demonstrate the problem I
described above.
MyInitialView.mxml wrote
> [Bindable] private var anyClass:ClassA = new ClassA();
> protected function onTextInputChangeA(event:Event):void
> {
> anyClass.fieldA = myTI1.text;
> }
>
> protected function onTextInputChangeB(event:Event):void
> {
> anyClass.subClass.fieldB = myTI2.text;
> }
> ...
> <js:VContainer width="500">
> ...
>
> <js:TextInput id="myTI1" text="Change Value"
> change="onTextInputChangeA(event)"/>
>
> <js:Label id="lbl" text="{anyClass.fieldA}" width="300"/>
> </js:VContainer>
> <js:VContainer width="500">
> ...
>
> <js:TextInput id="myTI2" text="Change Value"
> change="onTextInputChangeB(event)"/>
>
> <js:Label text="{anyClass.subClass.fieldB}" width="300"/>
> </js:VContainer>
ClassA or 'anyClass' wrote
> public class ClassA extends EventDispatcher
> {
> [Bindable] public var subClass:ClassB = new ClassB();
>
> public function ClassA() { }
>
> private var _fieldA:String = "";
>
> [Bindable("fieldAChanged")]
> public function get fieldA():String
> {
> return _fieldA;
> }
>
> public function set fieldA(value:String):void
> {
> if (value != _fieldA)
> {
> _fieldA = value;
> dispatchEvent(new Event("fieldAChanged"));
> }
> }
> }
ClassB or 'subClass' inside 'anyClass' wrote
> [Bindable] public class ClassB extends EventDispatcher
> {
> public function ClassB()
> {
> }
>
> private var _fieldB:String;
>
> [Bindable(event="fieldBChanged")]
> public function get fieldB():String
> {
> return _fieldB;
> }
>
> public function set fieldB(value:String):void
> {
> if (value != _fieldB)
> {
> _fieldB = value;
> dispatchEvent(new Event("fieldBChanged"));
> }
> }
> }
--
View this message in context:
http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Data-binding-fails-when-following-multiple-references-tp58022p58027.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.