1 Reply Latest reply on Jan 3, 2007 12:23 PM by ntsiii

    Viewstack oddities

    Chielosos
      Hello,

      I don't know if anybody has experienced the following, but after hours of breaking my brain on a problem I found the following:

      It seems that nested objects in a Viewstack cannot be addressed by their id. Not just by referencing them as {name}.id in AS code, but also not by using getChildByName. The nested objects just don't seem to exist. The compiler doesn't complain, but running the App results in nothing happening (and since I develop using the SDK on Linux, I have no errors that I can check). As soon as I move the nested object outside the viewstack container, everything works like a charm again.

      So now I'm working on removing all the viewstacks from my App (which sucks really bad, but the deadline I need to keep sucks even worse) but I would love to hear if other people have stumbled upon this problem too. And I would love to know if this is classified as "a feature" or "a bug".

      Thanks in advance for responding.

      Michiel.
        • 1. Re: Viewstack oddities
          ntsiii Level 3
          Are you aware that ViewStack and several other containers use "deferred instantiation" by default? this means that the child views of the viewstack do not exist until a user clicks to view them. You cannot access any child of a viewstack until it has been viewed.

          The fast fix for this is to set creationPolicy="all" on the viewstack. But this has negative impact on the start-up performance of the application, since every control must now renderer before the user can interact with the app.

          The correct solution is to craft the application so that you do not attempt to address the child components directly from the "outside", but rather use binding and event-driven logic to fetch the data when the child is viewed.

          If this is not your issue then never-mind.

          Tracy