This content has been marked as final. Show 4 replies
"WayneAtCrd" <firstname.lastname@example.org> wrote in message
>I have a problem that happens reproducibly, but when I attach the debugger,
> goes away.
> I have two AdvancedDataGrids, each having the data provider set up like
> private var xmlList: XMLListCollection = new XMLListCollection();;
> var hierarchical:HierarchicalData = new HierarchicalData(xmlList);
> myGrid.dataProvider = hierarchical;
> I use a different "myEventHandler" for each of the two grids.
> The problem is that, for one of the grids, when the data changes, it
> the other grid's event handler.
> Normally, I would think that there is some subtle coding error on my part.
> But when I attach a debugger, it works correctly!
> Does anybody have any theories about what could be wrong that would cause
> problem like this, but work correctly when the debugger is attached?
> I was experiencing this problem with Flex 3.1, so I upgraded to 3.2 and
> have the problem.
var hierarchical:HierarchicalData = new HierarchicalData(xmlList);
This means that hierarchical is just wrappping xmlList. When one changes,
the other changes, since they're the same thing. It's like saying:
var you:Person = new Person(wayne);
var car:carWithDriver = new carWithDriver(you);
If you move the arm on you, the arm will move on the driver in the car, too,
since it's you.
Thanks Amy, but I'm using a "new XMLListcollection()" for each grid, not re-using the same one.
Anybody have experience with problems that go away when using the debugger?
I'm with Amy. "new" just creates an instance, it does not assure independence. You have not shown enough code to convince me this is not the issue. Really, you have just shown 'sample' code. Or do bothe grids really call the same "myEventHandler"?