4 Replies Latest reply on Mar 6, 2012 8:25 AM by kkudiksx

    Flex 4.5.1 - children of component initialised but creationComplete is not called

    kkudiksx Level 1

      Hi

       

      I have a custom component which extends mx:VBox, and inside it I have 8 custom children components.

       

      On the custom components view, the creationComplete handler gets called and tries to set some states for the children but I get null pointer exceptions that some of children's components do not exist.

       

      I have noticed that the children's creationComplete handler never gets called. Their initialisation handler though gets called.

       

      I have tried to change the creationPolicy to all but it made no difference.

       

      Is there anything in particular I'd hae to look at since the creationComplet ehandler is not invoked?

       

       

      <?xml version="1.0" encoding="utf-8"?>

      <mx:VBox

          width="100%" height="100%"

          creationComplete="setUserWelcomeString();"

          xmlns:mx="library://ns.adobe.com/flex/mx"

          xmlns:fx="http://ns.adobe.com/mxml/2009"

          xmlns:presentation="com.test.presentation.*"

       

          <mx:ApplicationControlBar

              width="100%"

              horizontalAlign="right"

              verticalAlign="middle">

              <mx:Text

                  width="97%"

                  left="10"

                  fontSize="14"

                  fontThickness="12"

                  fontWeight="bold"

                  textAlign="left"

                  selectable="false" text="{userWelcomeString}"/>

                          <mx:Button label="Test TimeOut" visible="{sleepButtonVisible}" />

              <mx:LinkButton id="help"

                  width="60"

                  color="gray"

                  textAlign="right"

                  label="Help">

          </mx:ApplicationControlBar>

       

       

          <presentation:DashboardSearchView initialize="trace('initialise search view');" creationComplete="trace('searchviewcomplete');" creationPolicy="all"/>

          <presentation:DashboardMyApproval initialize="trace('initializeapproval');" creationComplete="trace('approvalcomplete');" creationPolicy="all"/>

          <presentation:DashboardPendingApproval creationPolicy="all"/>

          <presentation:DashboardReviewsDue creationPolicy="all"/>

          <presentation:DashboardHistCreditApplications creationPolicy="all"/>

          <presentation:DashboardRatingWriteups creationPolicy="all"/>

          <presentation:DashboardNotifications creationPolicy="all"/>

             

      </mx:VBox>

       

      So for DashBoardSearchView for example the initilisation handler is called but its creationComplete handle is not called.

       

      I added the creationPolicy to experiment. but to no avail..

       

      any help would be much appreciated!