4 Replies Latest reply on Sep 14, 2010 2:50 PM by tyuiop86

    PopupAnchor inside a custom component


      Hi All,


      I have an autoComplete custom component built using a TextInput control and PopupAnchor, and I am having problem trying to re-use the component.

      The problem is the component only built the PopupAnchor once, then refer to the same popup every time I instantiate the autoComplete else where.


      For instance, I have the autoComplete on the app header and I want to reuse it on a item order screen. Since the component does not create a new instance of popup, if I do something on the item order screen, the autoComplete would popup on the header instead of the screen.


      Is it even possible to have multiple PopupAnchor in one application ? or probably a property that I can set so that PopupAnchor is destroyed on displayPopup = false ?


      Please help.. thanks..

        • 1. Re: PopupAnchor inside a custom component
          Flex harUI Adobe Employee

          Run a test with two DropDownLists.  They work independently don't they?

          1 person found this helpful
          • 2. Re: PopupAnchor inside a custom component
            tyuiop86 Level 1

            Can you explain more where to add the DropDownList ? I tried adding a drop down in my custom component, then use my custom component in two different places, both drop down works fine.

            Does drop down list use PopUpAnchor ?


            My custom component is an actionscript class with a skin.. below is the mxml markup from the skin for the popUpAnchor:

            <s:PopUpAnchor id="popUp"

            is there any other property I need to set up ?


            Thanks for the reply, I really need help on this one..

            • 3. Re: PopupAnchor inside a custom component
              tyuiop86 Level 1

              One more thing.. I have found one work around which is to add static public variable to store the x and y coordinates of the popUpAnchor


              so in my SearchBar.as component I have:


              static public var xPos:Number;

              static public var yPos:Number;


              and in my skin, I bind PopUpAnchor x and y to those var:

              <s:PopUpAnchor id="popUp"
                      x="{SearchBar.xPos}" y="{SearchBar.yPos}"


              What I dont' undestand is I've seen other people's component that uses PopUpAnchor and it doesn't have this problem.. so there must be something that I am missing right ?

              • 4. Re: PopupAnchor inside a custom component
                tyuiop86 Level 1

                help anyone ? harUI ?