3 Replies Latest reply on May 27, 2009 9:17 AM by Bob in SC

    calling resize errect on popup doesn't work from parent

    Bob in SC

      I have a popup window which, when an checkbox is seletected, will grow from "small" to "big". That works fine when i select the checkbox while viewing the popup. However if i later want to cause this to happen from the parent it doesn't seem to occur. Why is this.

       

      More detail and a second question...

       

      So the checkbox has a click event handler (click="DisplaySecondaryServerPool()) and inside this handler is all call to make the popup get larger (

      bigResize.play()). All that works fine while i'm in the popup.

       

      However if i try and select the checkbox from the parent, two things happen that i do not understand.

      1) the event handler for the checkbox isn't called. I can see the that the checkbox is in fact selected (checked) but the DisplaySecondaryServerPool() handler isn't called. Why is this.

      2) so I decided to call DisplaySecondaryServerPool() directly from the parent window. It executes and for the most part does what i would expect (make some items visible that were invisible and enables some optional features) but the window does not resize even though the bigResize.play() method is called. Why is this.

       

      BTW...here the resize effect/method.

       

       

       

      <mx:Resize

       

      id = "bigResize" heightFrom="506" heightTo="602" target="{this}" />

        • 1. Re: calling resize errect on popup doesn't work from parent
          Michael Borbor Level 4

          I think that is an issue with the components lifecycle, post your whole code how do you create the pop up, and set the resize effect?

           

          There lies your problem most likely.

          • 2. Re: calling resize errect on popup doesn't work from parent
            Michael Borbor Level 4

            I think that is an issue with the components lifecycle, post your whole code

            how do you create the pop up, and set the resize effect?

             

             

             

            There lies your problem most likely.

            • 3. Re: calling resize errect on popup doesn't work from parent
              Bob in SC Level 1

               

               

               

               

               

               

               

               

               

               

               

               

               

               

              OK i've attached them and copy/pasted the relevent parts. The parent window is the SFLB file.

               

               

               

              -----------------------------------------here's the code in the parent window

              private function editServerPool():

              void

              {

               

              serverPoolPUW = PopUpManager.createPopUp(

              this,popups.ServerPoolPopup,true);

              PopUpManager.centerPopUp(serverPoolPUW

              as IFlexDisplayObject);

               

               

               

               

               

               

               

               

               

              if (newServerPool.SecondarySPAlgorithm != null)

              {

              serverPoolPUW.enableSSCheckBox.selected =

              true;

              serverPoolPUW.DisplaySecondaryServerPool();

               

               

              serverPoolPUW.bigResize.play();

              // serverPoolPUW.height = 602; //yes...i know i need to move this

              serverPoolPUW.switchoverPolicyCB.selectedItem = newServerPool.SwitchOverPolicy;

              serverPoolPUW.switchoverThresholdTI.text = newServerPool.SwitchOverThreshold;

               

              }

              }

               

               

              ----------------------here's the code in teh popup window (popups.ServerPoolPopup.mxml)

               

               

               

              <mx:Resize id = "bigResize" heightFrom="506" heightTo="602" target="{this}" />

               

               

              <mx:Resize id = "littleResize" heightFrom="602" heightTo="506" target="{this}"/>

               

               

              public function DisplaySecondaryServerPool():void

              {

               

              //make the screen large if the secondary server checkbox is selected; otherwise small.

               

              if (enableSSCheckBox.selected)

              {

               

              //display secondary server pool tab, expand the screen

               

              //note that we cannot attach a data provider to the data grid until the grid creation is

               

              //completed. This is done in an event handler.

              secondaryPanel.enabled =

              true;

              switchoverPolicyCB.visible =

              true;

              switchoverThresholdTI.visible =

              true;

              thresholdFI.visible =

              true;

              policyFI.visible =

              true;

              bigResize.play();

              }

               

              else

              ...

               

               

              <mx:CheckBox label="Enable a Secondary Server Pool" width="264" fontWeight="bold" click="DisplaySecondaryServerPool()"

              id="

              enableSSCheckBox" fontSize="12" x="83" y="40"/>