2 Replies Latest reply on Sep 11, 2008 5:30 AM by Newsgroup_User

    Creationcomplete Problem

    ravi_bharathii
      I have a viewstatck within that i have some child component to show.I
      have some link button, on click of the link button i am setting the
      selectedchild of the viewstack.With in the component i am calling
      creationcomplete method.It works fine when i clicked at first time the
      creationcomplete method is called. But when i click on second time the
      creation complete event is not calling.I am doing some validation
      based on the creationcomplete method.Is their is any way to call the
      creationcomplete method every time .Or anyworkaround for ths
        • 1. Re: Creationcomplete Problem
          Karl_Sigiscar_1971 Level 3

          As the name implies, creationComplete is only called when the creation of the component is complete.

          If the creationPolicy of the Viewstack is set to all, the creationComplete event will be dispatched only once for each component.

          If the creationPolicy of the Viewstack is not set to all,t he creationComplete event will be dispatched every time for each component.

          http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Live Docs_Book_Parts&file=layoutperformance_119_05.html
          • 2. Re: Creationcomplete Problem
            Level 7

            "Karl_Sigiscar_1971" <webforumsuser@macromedia.com> wrote in message
            news:gaap6i$24f$1@forums.macromedia.com...
            > As the name implies, creationComplete is only called when the creation of
            > the
            > component is complete.
            >
            > If the creationPolicy of the Viewstack is set to all, the creationComplete
            > event will be dispatched only once for each component.
            >
            > If the creationPolicy of the Viewstack is not set to all,t he
            > creationComplete
            > event will be dispatched every time for each component.
            >
            >
            > http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?co
            > ntext=LiveDocs_Book_Parts&file=layoutperformance_119_05.html
            >

            Children of navigator containers are not destroyed when you navigate to
            other panes, so they are not created again when you navigate back.

            One way to handle this is to use bindings to "pull" the data into the
            component.

            The way I handle it is to call invalidateProperties() on change of the
            ViewStack. I then override commitProperties() and call an "initializer" for
            each pane. In the body of each initializer function, I check to see if the
            selectedItem for the viewStack is the one my initalizer cares about. If
            not, I return from the function immediately. Inside that initializer
            function, I set properties and add listeners as appropriate.