Here's another work-around Brian: public function handleTreeItemChange(event:ListEvent):void { callLater(getItemRenderer); }
public function getItemRenderer():void { debugTextArea.text = "ListEvent's itemRenderer: " + testTree.itemToItemRenderer(testTree.selectedItem); } -TH --- In flexcoders@yahoogroups.com, "lachance.brian" <lachance.br...@...> wrote: > > Hi, Tim, > > Thanks for the tip! I hadn't thought of that as a direct workaround > of sorts, but that does open the doors for another way to get it to > work, I think :) > > It's not-so-much accessing the data that's the problem with this bug > (which I probably should have explained), but rather some of the > fields of the itemRenderer--specifically, the depth field. I guess I > could, instead of relying on that field, just traverse the tree > upwards from the selectedItem and calculate the depth manually in the > "bug" case. > > Thanks again, Tim! > -Brian > > > > --- In flexcoders@yahoogroups.com, "Tim Hoff" TimHoff@ wrote: > > > > > > Hi Brian, > > > > Nice post. Yeah, that is wierd; looks like a bug. You can get around > > it for now, by looking at the data instead: > > > > public function handleTreeItemChange(event:ListEvent):void > > { > > debugTextArea.text = "ListEvent's selectedItem: " + > > testtree.selectedit...@label <mailto:testtree.selectedit...@label ; > > } > > > > -TH > > > > --- In flexcoders@yahoogroups.com, "lachance.brian" <lachance.brian@> > > wrote: > > > > > > Hi, Group! > > > > > > I'm having some trouble with the Tree component in the Flex framework: > > > > > > When browsing a Tree with an XML-based dataProvider, I seem to be > > > unable to retrieve the itemRenderer field of the ListEvent event that > > > gets fired when the selected item changes (ListEvent.CHANGE). The > > > itemRenderer field is expected to not be null, but, I'm apparently > > > expecting the wrong thing. > > > > > > Has anyone ever ran into this issue? I've searched the Adobe JIRA > > > system and Google (and this list!), and I've yet to find a helpful > > > result. There were some previous bugs in the bug repository, but they > > > were transferred over from an old system. I've submitted the request > > > for more information, so we'll see where that goes. > > > > > > An example MXML file follows below. To see the "bug", scroll down > > > through the XML list until the parent item is out of view. Then, > > > select one of the children currently in view and press the left-key > > > to try to go to the parent item. Notice that the itemRenderer is > > > null, and this is where my problem arises. > > > > > > Thank you in advance for any help you're able to provide! > > > > > > MXML file: > > > http://pastebin.com/fd4614a > > > > > > P.S. This is my first time posting on a newsgroup, so I hope that > > > the formatting and whatnot worked out in an acceptable way. I > > > apologize if that's not the case. > > > > > >