6 Replies Latest reply on Apr 21, 2010 11:33 AM by WeeJavaDude

    Immediate Open after Close with PopUpButton

    WeeJavaDude

      We are using a number of PopUpButton controls and are seeing some strange behavior.  When we try and close the button it immediately pops up 2 times and on the 3 starts to behave as expected.   This pop up button is on a View Stack and in a nested container.   I have not been able to figure out where the source of the open is coming from immediatly after the close.  I have done a lot of searching and have found some posts around ViewStacks and the popupbutton but nothing that sounds like what we are experiencing.

       

      I know this is not a lot to go on, but thought I would give it a try.  Is there any tips that might be helpful in troubleshooting this issue?   Is there a way to figure out the source ("Where a event was dispatched")?   Any thoughts or troubleshooting tips would be helpful as my normal set of troubleshooting has not provided any clue to this point what might be causing this behavior.

       

      Thanks in advance for any suggestions you might have.

        • 1. Re: Immediate Open after Close with PopUpButton
          archemedia Level 4

          Can you post a simple example which demonstrates the behaviour?

           

          Dany

          • 2. Re: Immediate Open after Close with PopUpButton
            WeeJavaDude Level 1

            Well after a long day narrowing it down it appears to be related to having tabChildren set to false in the containing container.  I left out the menu code but it is just some dummy XML. When I did this I can open it and then when I try click to close I get an immediate open.  After doing this 3 times it starts to behave properly.

             

            Below is the example.

             

                <mx:Canvas tabChildren="false">
                    <mx:PopUpButton id="printPopUp"
                                    width="80"
                                    label="Print"
                                    creationComplete="initMenu();"
                                    left="5"
                                    openAlways="true"/>

             

                </mx:Canvas>

             

            For completeness. I am running 3.5 SDK on Player 10 (Released)

            • 3. Re: Immediate Open after Close with PopUpButton
              WeeJavaDude Level 1

              It appears that if I do this I will also get the same result

               

                      <mx:PopUpButton id="printPopUp"
                                      width="80"
                                      label="Print"
                                      creationComplete="initMenu();"
                                      left="5"
                                      openAlways="true" tabEnabled="true"/>

               

              Looks to me that PopUpButton does not like its tab being disabled.

              • 4. Re: Immediate Open after Close with PopUpButton
                archemedia Level 4

                Hi,

                 

                I do have to see what's in your initMenu function.

                 

                d

                • 5. Re: Immediate Open after Close with PopUpButton
                  WeeJavaDude Level 1

                  Here is what is in the InitMenu

                   

                   

                              public var printMenuItems:XMLList =
                                  <>
                                      <menuitem id="menu1" label="Menu1" data="menu1" enable="true" />
                                      <menuitem id="menu2" label="Menu2" data="menu2" enable="true" />
                                      <menuitem id="menu2" label="Menu2" data="menu3" enable="true" />
                                  </>;

                   

                   


                              private function initMenu():void
                              {
                                  printMenu = new Menu();

                   

                                  printMenu.labelField = "@label";

                   

                                  printMenu.dataProvider = printMenuItems;

                   

                                  printPopUp.popUp = printMenu;

                   

                                  printPopUp.addEventListener(DropdownEvent.OPEN, openHandler);
                                  printPopUp.addEventListener(DropdownEvent.CLOSE, closeHandler);
                                  printPopUp.addEventListener(MouseEvent.CLICK, clickHandler);
                              }

                  • 6. Re: Immediate Open after Close with PopUpButton
                    WeeJavaDude Level 1

                    This definitely to me appears to be a defect.   I guess the next step would be to submit unless someone indicates not to.