4 Replies Latest reply on May 15, 2009 4:02 PM by mickey3

    catching events?

    mickey3

      Hi

       

      So I throw an event from my popup title window just about when it closes.

       

      On some "disconnected" component, I had it do like this:

       

      addEventListener("newSiteSave", newSiteSaveEvent );

       

      which my title window popup event dispatches.

       

      But my other compnent never sees/catches that event any idea?

       

      I was expecting like if any component dispatches an event - you can catch the event anywhere.

        • 1. Re: catching events?
          ATIF FAROOQ Level 3

          hi,

             associated component that dispatched the Event will listen to the Events Too so you will need to add EventListener to titleWindow.

          • 2. Re: catching events?
            mickey3 Level 1

            hmm not clear with the answer i probably need to explain more. From the documentation, if your flex app looks something like this:

             

            Application
                Panel
                    TitleWindow
                        Button

             

            And when the button fires up an event, it will bubble up to the Application right?

             

            What if my app looks someting like this:

             

            Application
                Panel
                    TitleWindow
                        Button
                Panel2

            See how Panel2 is completely not in the parent->child relationship? Can Panel2 register for the custom event
            that Button generates and catch it?

            Thanks


            • 3. Re: catching events?
              ATIF FAROOQ Level 3

              All PopUps are parented by SystemManager so in order catch Event in your panel2  that is dispatched by The button in TitleWindow.You will have to add Listener on systemManager instead

               

              this.systemManager.addEventListener('siteEvent',listener)
              
              • 4. Re: catching events?
                mickey3 Level 1

                thanks it works.