Skip navigation
lndgrniker
Currently Being Moderated

Bug? Retrieve ItemRenderer instances from a dataGroup

Oct 12, 2010 2:35 PM

Hi guys (and girls),

Working in FLEX 4:

I’m experiencing something funny.

I’m trying to retrieve ItemRenderer instances from a dataGroup by using getElementAt().

Everything works if I call the method when the application is up and running, lets say I call the method by clicking a button.

If I try to call the method programmatic some other way, before the program is up and running, the getElementAt() returns null.

Here’s the funny part though …

Let’s say I’m calling my getElementAt() method through a changeWatcher (programmatic, before the program is up and running) it dosen’t work If I simply run the application. But if I set a breakpoint and use the variables view to open and inspect my DataGroups private Array “indexToRenderer”, then everything works fine when I resume the application. How can that be?


Bug?

Please help!

/Erik

 
Replies
  • Currently Being Moderated
    Oct 12, 2010 4:33 PM   in reply to lndgrniker

    If you are using virtualLayout, getElementAt may not work as expected.  It

    may also depend on when data arrives.

     

    The debugger reads getters and can affect the order that code runs.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points