That sounds like a bug.  Internally [] just ends up calling getItemAt,
so there must be something in the setup that causes binding to execute
one more time using the array brackets.  Can you please file a testcase
at http://bugs.adobe.com/flex?

Matt

-----Original Message-----
From: Ian Skinner [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 17, 2007 1:15 PM
To: Flex
Subject: The difference between getItemAt() and []

Can somebody explain in simple terms what the difference between these 
code blocks is, and why the former works correctly, but the latter does
not?

<mx:Binding destination="filterParams.severity_min" 
source="filter_severity.values[0]"/>
<mx:Binding destination="filterParams.severity_max" 
source="filter_severity.values[1]"/>

This works as desired, but produces the following warnings in my IDE.

"Data binding will not be able to detect changes when using square 
bracket operator.  For Array, please use ArrayCollection.getItemAt() 
instead."

But using the suggested form, produces incorrect results, no value is 
returned.

<mx:Binding destination="filterParams.severity_min" 
source="filter_severity.values.getItemAt(0)"/>
<mx:Binding destination="filterParams.severity_max" 
source="filter_severity.values.getItemAt(1)"/>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: http://www.houseoffusion.com/groups/Flex/message.cfm/messageid:4487
Subscription: http://www.houseoffusion.com/groups/Flex/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37

Reply via email to