Hi, I'm seeing odd behaviour when updating a single property of an item in an
arraycollection.
Given an ArrayCollection:
[Bindable]
public var arr:ArrayCollection = new ArrayCollection()
which contains objects like this:
[Bindable]
public class ClassA{
public var prop1:String;
public var prop2:String;
}
Then: I put an object in the collection:
var a:ClassA = new ClassA()
a.prop1 = 'first'
a.prop2 = 'second'
arr.addItem(a)
Later, I find that object in the array (the Util.findObject is my code, and
it does find the object, that's not the problem)
var a:ClassA = Utils.findObject(arr, 'prop1', 'first')
a trace on a shows that prop1='first' and prop2 = 'second'
Now, here's the problem, I update one of these properties, and the rest are
all set to null !!
a['prop2'] = 'third'
arr.refresh()
Now a trace on object 'a' shows that prop1 is null, and the DataGrid shows a
blank cell where object a's prop1 was!
Does that make sense?
David
--
View this message in context:
http://apache-flex-users.2333346.n4.nabble.com/Odd-behavior-in-ArrayCollection-tp10526.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.