5 Replies Latest reply on Aug 31, 2006 11:25 AM by dimival

    Passing Event Data to a PopUp Window

    Josh Johnson
      So currently, I have a DataGrid, which has a doubleClick event handler that calls a function that opens a custom component based off a TitleWindow. So far so good. What I want to do is pass the object that corresponds to the row in the DataGrid which was double clicked to the TitleWindow, so I can there dissect it's properties and use those to populate a variety of fields. I've made some pretty good progress, where my window function looks like this:

      public function openSWindow(e:MouseEvent):void {
      var s1:SWindow = SWindow(
      PopUpManager.createPopUp(this,SWindow,false));
      // used to populate the name of the window with the name of the double clicked object
      s1.title = e.target.name;
      //device is a public variable in the TitleWindow meant to house the object
      s1.device = e.target;
      }

      But when I run this, instead of the name property of the object which I expected to be used to populate the title, I instead get: "DataGridItemRenderer641", which makes me think I'm not referencing the event target correctly.

      I've successfully used the selectedItem.name attribute of the DataGrid to populate other labels in the same main window, so I guess I naively thought that same 'selectedItem' would be passed as the target of the doubleClick event. Is there some easy way to introspect the event target that's getting passed, so I know what it is I'm supposed to be dealing with?