cmsanche
05-07-2007, 08:54 PM
I get this error with this simple component I'm creating.
Data binding will not be able to detect changes when using square bracket operator. For Array, please use ArrayCollection.getItemAt() instead.
Is there a better way to do this?
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="pmTreeRPC.send ()">
<mx:Script>
<![CDATA[
import mx.controls.List;
import mx.collections.XMLListCollection;
import mx.rpc.events.ResultEvent;
[Bindable]
public var view:String;
[Bindable]
public var rootElement:String; ]]>
</mx:Script>
<mx:HTTPService id="pmTreeRPC" url="{'https://mysite.com/tree.php?view=' + view}" resultFormat="e4x"/>
<mx:Tree id="pmTree" height="100%" dataProvider="{pmTreeRPC.lastResult[rootElement]}" labelField="@name" showRoot="false" minWidth="250"/>
</mx:HBox>
Data binding will not be able to detect changes when using square bracket operator. For Array, please use ArrayCollection.getItemAt() instead.
Is there a better way to do this?
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="pmTreeRPC.send ()">
<mx:Script>
<![CDATA[
import mx.controls.List;
import mx.collections.XMLListCollection;
import mx.rpc.events.ResultEvent;
[Bindable]
public var view:String;
[Bindable]
public var rootElement:String; ]]>
</mx:Script>
<mx:HTTPService id="pmTreeRPC" url="{'https://mysite.com/tree.php?view=' + view}" resultFormat="e4x"/>
<mx:Tree id="pmTree" height="100%" dataProvider="{pmTreeRPC.lastResult[rootElement]}" labelField="@name" showRoot="false" minWidth="250"/>
</mx:HBox>