1 Reply Latest reply on Mar 7, 2012 9:24 AM by Flex harUI

    Is creationComplete on VGroup's children unordered?

    kkudiksx

      I have a VGroup with several children.

       

      The visual end result is what I am expecting, however the creationComplete for each element does not get invoked in the order they are defined in the MXML file.

       

      Is this the expected behaviour of VGroup?

       

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

      <s:VGroup

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

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

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

          xmlns:s ="library://ns.adobe.com/flex/spark"

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

       

          <fx:Script>

              <![CDATA[

       

               import mx.core.FlexGlobals;

              import mx.utils.StringUtil;

       

       

              [Bindable]

              [Inject]

              public var searchModel:DashboardSearchPM;

       

       

              [Bindable]

              private var _userprofile:UserProfile;

       

               public function get userProfile():UserProfile {

                  return this._userprofile;

              }

       

       

              public function set userProfile(userPr:UserProfile):void {

                  this._userprofile = userPr;

                  setUserWelcomeString();

              }

       

       

                 public function createComplete():void {

                  setUserWelcomeString();

              }

       

       

              public function setUserWelcomeString():void {

                  searchModel.userName = userProfile.user.firstName + " " + userProfile.user.surname;

                  userWelcomeString = "Welcome " + searchModel.userName;

                  urlToHelp = 'http://' + ApplicationParameters.serverName + ':' + ApplicationParameters.port + ApplicationParameters.contextRoot + '/help.jsp';

              }

       

       

              [Bindable]

              private var userWelcomeString:String;

       

               }

              ]]>

          </fx:Script>

       

       

           <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:LinkButton id="help"

                  width="60"

                  color="gray"

                  textAlign="right"

                  label="Help"

                  click='navigateToURL(new URLRequest(urlToHelp));'/>

          </mx:ApplicationControlBar>

       

           <presentation:DashboardSearchView  />

          <presentation:DashboardMyApproval/>

          <presentation:DashboardPendingApproval/>

          <presentation:DashboardReviewsDue />

          <presentation:DashboardHistCreditApplications />

          <presentation:DashboardRatingWriteups />

          <presentation:DashboardNotifications />

       

       

       

       

      </s:VGroup>

       

       

      I would expect that the creationComplete for DashboardSearchView gets invoked first, then the creationComplete for DashboardMyApproval gets invoked second, the creationComplete of DashboardPendingApproval third and so on.

       

      Presently what happens it that the creationComplete order of the children occurs randomly and therefore I cannot apply any ordered logic I may need to do on each component's creationComplete.

       

      Is there anyway to ensure that the creationComplete of each child happens one after the other?

       

      Regards and many thanks