0 Replies Latest reply on Nov 28, 2013 5:06 PM by Kiran_Patil

    Popup inside Popup button is not displayed comletely on height change.

    Kiran_Patil

      Hi,

       

      I m using a popup inside popupbutton.

      In this popup i have  a button.

      On clicking the button I change the height of button.

      But the popup height is not reflected immediately after changing height.

      I can see the changed height after closing and opening the popup again.

      I have added  the popup and sample appliication code below. Please help.

       

       

      ======================PopUp========================

      TextUI.mxml

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

      <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="100%"

               backgroundColor="yellow" verticalAlign="middle">

         

          <mx:Script>

              <![CDATA[

                  [Bindable]

                  public var ht:int =300;

                  protected function button1_clickHandler(event:MouseEvent):void

                  {

                      mytext.htmlText = "<TEXTFORMAT LEADING='2'><P ALIGN='CENTER'><FONT FACE='Aller-Regular' SIZE='16' COLOR='#000000' LETTERSPACING='0' KERNING='0'> All Devices </FONT></P><P ALIGN='CENTER'><FONT FACE='Aller-Regular' SIZE='14' COLOR='#000000' LETTERSPACING='0' KERNING='0'>176545</FONT></P><P ALIGN='CENTER'><FONT FACE='Aller-Regular' SIZE='11' COLOR='#000000' LETTERSPACING='0' KERNING='0'>Impacted Subscribers</FONT></P></TEXTFORMAT>"//centerLabelNameFunction(//itemToLabel(item, isTotal);

                      ht =600;

                      this.measuredMinHeight = this.measuredHeight  =   ht;

                      invalidateSize();

                      validateNow();

                  }

                 

                  override protected function measure():void

                  {

                      super.measure();

                      this.measuredMinHeight = this.measuredHeight  =   ht;

                     

                  }

              ]]>

          </mx:Script>

         

          <mx:Button click="button1_clickHandler(event)"/>

          <mx:Text id="mytext" width="100"/>

      </mx:VBox>

       

      ========================================================================================== ======

       

      =========================================Application====================================== ========\

      TextUITest.mxml

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

      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"

                      minWidth="955" minHeight="600" xmlns:local="*">

          <mx:Script>

              <![CDATA[

                  import mx.core.IFlexDisplayObject;

                  import mx.events.ResizeEvent;

                  import mx.managers.PopUpManager;

                  var ui:digBox =new digBox();

                  [Bindable]   

                  public var arr:Array = ["1","2","3"]

                 

                  protected function textui1_resizeHandler(event:ResizeEvent):void

                  {

                      toggleButton.invalidateDisplayList();

                      (toggleButton.popUp as TextUI).invalidateSize()

                      (toggleButton.popUp as TextUI)

                     

                      this.invalidateSize()

                      this.validateNow()

                  }

                 

              ]]>

          </mx:Script>

          <mx:PopUpButton id="toggleButton"  x="600"

                               height="16" width = "16" fontWeight="normal" openAlways="true"  visible="true" popUpGap="8">

              <mx:popUp >

                  <local:TextUI width="100%" id="textui" height="100%" resize="textui1_resizeHandler(event)"/>

          </mx:popUp>

         

          </mx:PopUpButton>

      </mx:Application>

      ========================================================================================== ========================