[ https://issues.apache.org/jira/browse/FLEX-25767?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Justin Mclean updated FLEX-25767: --------------------------------- Labels: easyfix easytest (was: ) > executeBindings recursion doesn't effect ELEMENTS, only effects CHILDREN > ------------------------------------------------------------------------ > > Key: FLEX-25767 > URL: https://issues.apache.org/jira/browse/FLEX-25767 > Project: Apache Flex > Issue Type: Bug > Components: Spark: Application > Affects Versions: Adobe Flex SDK 4.0 (Release) > Environment: Affected OS(s): All OS Platforms > Affected OS(s): All OS Platforms > Language Found: English > Reporter: Adobe JIRA > Labels: easyfix, easytest > > Steps to reproduce: > <?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" > xmlns:ui="ui.*" > xmlns:components="lib.components.*" > > <fx:Declarations> > <fx:XML id="testData" xmlns=""> > <nodes> > <node text="stuff" /> > </nodes> > </fx:XML> > </fx:Declarations> > <s:layout> > <s:VerticalLayout id="myLayout" /> > </s:layout> > <fx:Script> > <![CDATA[ > import mx.core.UIComponent; > > > [Bindable] > public function set data(content:String):void { > this.testData = new XML(content); > this.executeBindings(true); > > } > > public function get data():String { > return this.testData.toXMLString(); > } > > [Bindable] > public function set selected(val:Boolean):void { > this.testData.node.@sel = val ? '1' : '0'; > this.b.executeBindings(true); > } > > public function get selected():Boolean { > return (this.testData.node['@sel'] == '1'); > } > > [Bindable] > public function set text(newText:String):void { > this.testData.node.@text = newText; > this.b.executeBindings(true); > } > > public function get text():String { > return testData.node.@text; > } > > > ]] > > > </fx:Script> > <s:TextInput id="a" text="@{text}" width="100%" /> > <s:CheckBox id="c" selected="@{selected}" > visible="{testData.node.hasOwnProperty('@sel')}" /> > <s:TextArea id="b" text="@{data}" width="100%" /> > > > </s:Application> > Actual Results: > changing the value of text area a or checkbox c causes setters text or > selected respectively to be called. These target text area b with execute > bindings which works. > However, setter 'selected' when called, using this.executeBindings doesn't > have the effect of updating a and b like it should. > > Expected Results: > changing the contents of the xml displayed in TextArea b should, when > executeBindings is called in the 'selected' setter update a and b', when > working properly adding a sel='1' to the node element within the text field > should make a checkbox visible and selected. > Workaround (if any): > After an experiment where I output this.numChildren and it displayed 1 > (rather than 3). I realized there was also numElements. Outputting > numElements I got the 3 I expected. So the following for loop does what I > expected executeBindings(true) to do: > Rather than this.executeBindings(true) I replace it with the following in > public function set data: > for( var i:int = 0; i< this.numElements; i++ ) { > UIComponent(this.getElementAt(i)).executeBindings(true); > } > // Note: I'm using getElementAt > I believe the solution here is to update the core functionality of > executeBindings so that it executes on child elements and not whatever > numChildren is referring to, or maybe loop through both elements and > children. > I'm marking it as a regression as there are reports from 2009 of > executeBindings not working that were marked as resolved. However it is still > an issue. > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira