Loading ...
Sorry, an error occurred while loading the content.

Re: [flexcoders] How to pass data to popup window?

Expand Messages
  • Paul Andrews
    ... From: markflex2007 To: Sent: Saturday, November 01, 2008 3:27 AM Subject: [flexcoders] How to pass
    Message 1 of 8 , Nov 1, 2008
    • 0 Attachment
      ----- Original Message -----
      From: "markflex2007" <markflex2007@...>
      To: <flexcoders@yahoogroups.com>
      Sent: Saturday, November 01, 2008 3:27 AM
      Subject: [flexcoders] How to pass data to popup window?


      > Hi ,
      >
      > I need pass data from main window to popup
      > window(mx:titlewindow).Please give me a idea how to do this.
      >
      > Please post here if you have a demo code to do this.

      Open at the flex 3 component explorer. Look at the TitleWindow example. All
      you need do is add a public variable to the title window, then you can refer
      to that from the parent after the title window has been created. You can
      make that public variable bindable to propogate it's value as you wish
      through binding.

      This is the no-frills way of doing it - just expose an attribute of the
      window publicly and refer to it as you would a member of any class.

      The example already shows how to pass back data to the calling window.

      Paul

      > Thanks
      >
      > Mark
    • Louise Rains
      I need to pass data back from a popup window. How is this done? The data consists of 2 numbers. Thanks, Louise
      Message 2 of 8 , Nov 1, 2008
      • 0 Attachment

        I need to pass data back from a popup window.  How is this done?

         

        The data consists of 2 numbers.

         

        Thanks,

        Louise

      • Louise Rains
        Oh, never mind about passing data back - I can see it in the example. It just seems a bit inelegant to poke it back in the parent window. Louise
        Message 3 of 8 , Nov 1, 2008
        • 0 Attachment

          Oh, never mind about passing data back – I can see it in the example.


          It just seems a bit inelegant to poke it back in the parent window.


          Louise

        • Paul Andrews
          You can send a custom event and use that to transport your data.. ... From: Louise Rains To: flexcoders@yahoogroups.com Sent: Saturday, November 01, 2008 3:16
          Message 4 of 8 , Nov 1, 2008
          • 0 Attachment
            You can send a custom event and use that to transport your data..
            ----- Original Message -----
            Sent: Saturday, November 01, 2008 3:16 PM
            Subject: [flexcoders] Re:How to pass data to popup window?

            Oh, never mind about passing data back – I can see it in the example.


            It just seems a bit inelegant to poke it back in the parent window.


            Louise

          • Tracy Spratt
            Not even a custom event. Dispatch an ordinary Event, with a specific name. In the handler, use the event.target reference to access the value in a public
            Message 5 of 8 , Nov 1, 2008
            • 0 Attachment

              Not even a “custom” event.  Dispatch an ordinary Event, with a specific name.  In the handler, use the event.target reference to access the value in a public property.

              Tracy

               


              From: flexcoders@yahoogroups.com [mailto: flexcoders@yahoogroups.com ] On Behalf Of Paul Andrews
              Sent: Saturday, November 01, 2008 11:57 AM
              To: flexcoders@yahoogroups.com
              Subject: Re: [flexcoders] Re:How to pass data to popup window?

               

              You can send a custom event and use that to transport your data..

              ----- Original Message -----

              Sent: Saturday, November 01, 2008 3:16 PM

              Subject: [flexcoders] Re:How to pass data to popup window?

               

              Oh, never mind about passing data back – I can see it in the example.


              It just seems a bit inelegant to poke it back in the parent window.


              Louise

            • Dmitri Girski
              Hi Louise, Why not to use good old callbacks? I see that everyone is obsessed now with the events, but this is so simple just to pass the value to the popup
              Message 6 of 8 , Nov 4, 2008
              • 0 Attachment
                Hi Louise,

                Why not to use good old callbacks? I see that everyone is obsessed now
                with the events, but this is so simple just to pass the value to the
                popup and when popup finishes, it will call the function. Simple.

                To do this, simply add the function to the popup window code.
                public function fMyInit(val1:uint, val2:uint, callback:Function):void
                {
                m_val1 = val1;
                m_val2 = val2;
                m_callback = callback;
                }


                Then, after you create a popup

                var popup:YourPopupCLass =
                YourPopupCLass(PopUpManager.createPopUp(YourPopupClass, parent, etc));

                initialise it.
                popup.fMyInit(1, 2, fOnPopupExit);


                and then define function fOnPopupExit(). You can even pass the
                parameters to it.


                In the YourPopupClass before closing the window, just make the call of
                the function m_callback();


                Cheers,
                Dmitri.









                --- In flexcoders@yahoogroups.com, "Louise Rains" <rainyglade@...> wrote:
                >
                > I need to pass data back from a popup window. How is this done?
                >
                >
                >
                > The data consists of 2 numbers.
                >
                >
                >
                > Thanks,
                >
                > Louise
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.