2 Replies Latest reply on May 2, 2006 2:11 AM by tiagoafpereira

    possible ViewStack bug

    tiagoafpereira
      There seems to be something wrong with the mx:ViewStack....

      I think the code is pretty obvious but what happens is that when a Tree is inside a ViewStack one cannot always define programatically it's dataProvider...
      This is quite strange and is seriously bothering me since I'm trying to use this type of interface in a project....

      Either that or I'm a complete n00b... lol
        • 1. Re: possible ViewStack bug
          ntsiii Level 3
          You may be seeing the deferred instantiation issue.

          ViewStack, and some of the other navigator/containers, use deferred instantiation by default. This means the children of a view, your tree for example, do not exist until the view has been selected. So you cannot programmatically access such a control until it has been made visible. The quick fix for this is to set the ViewStack creationPolicy="all". Be aware that this can have negative effects on performance for complex apps. Try it anyway.

          However, In your example though there is only one view in the voewstack, so I would have expected its children to be available. Perhaps you need to use the creationComplete event instead of initialize.

          Tracy
          • 2. Re: possible ViewStack bug
            tiagoafpereira Level 1
            Thanks!

            creationComplete event worked just fine!