2 Replies Latest reply on Dec 14, 2007 8:12 AM by yoav@cyteam.com

    Setting  SomeTree.selectedIndex = n not working as excpected

    yoav@cyteam.com Level 1
      I have a simple tree that is populated via a dataprovider : var projectData:XML that is created from an XML file by through initApplication() function triggered by the Application's "initialize" event.
      All is (apparently ) fine, tree is displayed with the proper labels and change/open/click event handlers.
      However, I'm trying to set the projectTree.selectedIndex=0; as part of the initialization sequence, by a initTree() function associated with the tree's creationComplete event. It DOESN'T Work .
      If I perform the assignment " projectTree.selectedIndex=0; " from a button action, its works OK (e.g. the node is highlighted as selected ). It's possible that the initialization sequence doesn't occur as I anticipate ? that the creationComplete event is fired before the tree is fully generated ?

      Any ideas were to look ?

      Thanks,
      Yoav Text