6 Replies Latest reply on Nov 20, 2009 6:51 PM by David_F57

    child creation policy

    TomDelorenzi Level 1

      I used to use this to contorl loading but the build I am using does not seem to have it, or createComponentsFromDescriptors. Were these removed? Is there a replacement? I have a large table that takes a bit to load and I want to preload it. Otherwise when its transition plays, the transition is over by the time the table is ready and it looks jerky.

        • 1. Re: child creation policy
          Flex harUI Adobe Employee

          It is still in the source code for mx:Container-based containers.  Did you switch to Spark containers?

           

          Alex Harui

          Flex SDK Developer

          Adobe Systems Inc.

          Blog: http://blogs.adobe.com/aharui

          • 2. Re: child creation policy
            TomDelorenzi Level 1

            Ah yes. Is there something compareable for spark? In my gui I often hit the situation where I want to set a property on one of my mxml elements in an as3 block but it may or may not have been seen so may be null. Just looking for the right wayto handle this.

            • 3. Re: child creation policy
              rfrishbe Level 3

              If you're using SkinnableContainer, try using createDeferredContent().

               

              -Ryan

              • 4. Re: child creation policy
                Flex harUI Adobe Employee

                createDeferredContent will work in both MX Container and Spark (in the few Spark containers that support creationPolicy)

                 

                Alex Harui

                Flex SDK Developer

                Adobe Systems Inc.

                Blog: http://blogs.adobe.com/aharui

                • 5. Re: child creation policy
                  TomDelorenzi Level 1

                  My top guy of importance here was a group, so I changed him to a skinnable container. I then put the creationPolicy="all" which now is allowed.

                  I then changed one of his children to the same and set him to all as well. He has a datagrid subclass. On that datagrid sub class I added a creationcompelte event. My expectation was that would happen as soon as the top guy was put on screen but it did not get triggered until i actually caused the bottom datagrid to be put on screen.

                   

                  so structure is

                  <s:SkinnableContainer .... creationPolicy="all">

                    <bunch of other children>

                    <s:SkinnableContainer id="gridContainer" includeIn="grid,gridFlip" width="100%" height="100%" creationPolicy="all">
                          <s:layout>
                              <s:VerticalLayout horizontalAlign="center" paddingLeft="10" paddingRight="10" paddingBottom="10" paddingTop="10"/>
                          </s:layout>
                          <ciq:CIQDataGrid id="grid" width="100%" height="100%" creationComplete="gridComplete()"/><----- function that didnt get called
                          <s:Button id="backButton" label="Back" click="{setCurrentState(preGridState)}"/>
                      </s:SkinnableContainer>
                  </s:SkinnableContainer>

                   

                  Am I not using this correctly?

                  [Update]

                  It was because he wasn't in the state that starts... Darn. Well maybe i will make him as a decleration and then add him in later or something.

                  • 6. Re: child creation policy
                    David_F57 Level 5

                    Hi,

                     

                    If you only want to have certain components in states available to you there is itemCreationPolicy="immediate" .

                     

                    David