10 Replies Latest reply on Apr 24, 2009 9:23 AM by TrinityPlanet

    Popupmanager display issue in AIR

    TrinityPlanet

      Hello Everybody!!

      I am working on an application where components have to be added/ removed from the main application window and added to new windows.
      The issue I am facing is with Comboboxes, tooltips (popupmanger impl) show up in the main application window rather than the popped up window. I am using mx:Windows as the popup window and mx:WindowedApplication as the main application window.
      For now it is  a stop ship. Any response is highly appreciated.

       

      Thanks & Regards

        • 1. Re: Popupmanager display issue in AIR
          Cesare Rocchi Level 2

          a UI component can have just one father.

          You have to remove your combobox from the main application, before adding it to the popup window.

           

          HTH.

          • 2. Re: Popupmanager display issue in AIR
            TrinityPlanet Level 1

            I agree, and thats what I am trying to achieve to remove the component and add it to new parent. The whole component with other controls in it gets added, accept for the combo and tooltips.

            • 3. Re: Popupmanager display issue in AIR
              Cesare Rocchi Level 2

              why did I say father? I should have said parent!

               

              can you post some code? just to have an idea of how you do it ...

              • 4. Re: Popupmanager display issue in AIR
                TrinityPlanet Level 1

                Below I have some snippets of the code

                //This method is used to add components to the main app.

                private function addManagedPod(parentComponent:Object, childComponent:ISphericallComponent, width:int, height:int):Object
                        {

                            // Managed pod is a class extended from panel 
                            var win:ManagedPod = new ManagedPod();   
                              
                                win.title = childComponent.componentTitle;
                                win.name = Math.random().toString();
                                win.addEventListener(POPOUT, handlePopOut);
                                win.visible = childComponent.componentVisible;
                               
                                childComponent.componentState = MANAGED_STATE;
                                childComponent.parentObject = win;
                               
                                win.addChild(DisplayObject(childComponent));


                                 //ParentComponent is a box which is added to the windowed application                     
                                parentComponent.addChild(win);
                                managedPodCollection.addItem(childComponent);
                            }else{
                                //Set Focus
                                //UIComponent(childComponent.parentObject).setStyle("borderColor", "#3399FF");
                            }
                            return win;
                        }

                 

                ////Add floating pods to mainframe
                        public function addFloatingPod(childComponent:ISphericallComponent, width:Number, height:Number):SphericallWindow
                        {

                          //Sphericall window is a extended from mx:window
                            var floatingPodWin:SphericallWindow = new SphericallWindow();
                            floatingPodWin.width = width;
                            floatingPodWin.height = height;
                            floatingPodWin.title = childComponent.componentTitle;
                            floatingPodWin.visible = childComponent.componentVisible;
                            childComponent.componentState = FLOATING_STATE;
                            childComponent.parentObject = floatingPodWin;
                            floatingPodWin.addChild(DisplayObject(childComponent));
                           
                            floatingPodWin.open();
                            return floatingPodWin;
                        }

                 

                // This how a child component looks like

                <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:local="com.necsphere.components.*"
                    creationComplete="startup()">

                          <mx:ComboBox id="stateComboBox" dataProvider="{choices}" width="50%" change="setPresence()"  />
                   
                             <controls:AutoComplete id="noteAutoComplete" width="50%" lookAhead="true"
                         enter="setPresence()" borderThickness="0" keepLocalHistory="true" defaultText="notes..." localHistoryName="noteAutoCompleteData"/>
                </mx:HBox>

                • 5. Re: Popupmanager display issue in AIR
                  Cesare Rocchi Level 2

                  You have many custom components. It is not easy to get oriented.

                   

                  This example shows you quickly that combobox has no problems to change

                  parent.

                   

                  <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">

                  <mx:Script>

                  <![CDATA[

                  import mx.core.Window;

                   

                  [Bindable]

                  public var test: Array = [ {label:"Visa", data:1},

                                  {label:"MasterCard", data:2}, {label:"American Express", data:3} ];

                                 

                                  private function testIT():void {

                                  mainCanvas.removeChild(myCombo);

                                  secondaryCanvas.addChild(myCombo);

                                  }

                  ]]>

                  </mx:Script>

                   

                  <mx:Canvas id="mainCanvas">

                  <mx:ComboBox dataProvider="{test}" id="myCombo"/>

                  </mx:Canvas>

                   

                  <mx:Button label="switch" click="testIT()"/>

                   

                  <mx:Canvas id="secondaryCanvas"/>

                   

                  </mx:WindowedApplication>

                   

                  ps: In any case you do not need to keep track of the parent when you do addChild().

                  • 6. Re: Popupmanager display issue in AIR
                    TrinityPlanet Level 1

                    Hi,

                    I have developed a sample testcase project please find attached the files.

                    let me know what is that I am doing wrong.

                    Thanks in advance

                     

                    Thanks & Regards

                    Vandana

                    • 7. Re: Popupmanager display issue in AIR
                      Cesare Rocchi Level 2

                      No source code in attachment,

                       

                      Please send it to

                       

                           Oqd2ZxpP6x2UBZl8@spambox.us

                      • 8. Re: Popupmanager display issue in AIR
                        TrinityPlanet Level 1

                        I get an

                        Delivery to the following recipient failed permanently:

                        • 9. Re: Popupmanager display issue in AIR
                          Cesare Rocchi Level 2

                          sent email via private message.

                          • 10. Re: Popupmanager display issue in AIR
                            TrinityPlanet Level 1

                            I have posted this as bug http://bugs.adobe.com/jira/browse/FB-18996

                            Also attached sample test case. Incase you can vote for it too would be great.Thanks in advance