2 Replies Latest reply on Apr 1, 2011 11:00 PM by liguanghe

    TitleWindow + DataGrid  when remove the popoup causing an error

    liguanghe

      Whenever i click a button from the DataGrid i dispatch an event to notify the parent application and then I remove the PopUp(TitleWindow) like this:

       

      code:

      <mx:DataGrid id="dg" dataProvider="{employees}">
        <mx:columns>
         <mx:DataGridColumn >
          <mx:itemRenderer >
           <fx:Component>
            <mx:HBox>
             <mx:Button click="outerDocument.close()"/>
            </mx:HBox>
           </fx:Component>
          </mx:itemRenderer>
         </mx:DataGridColumn>
        </mx:columns>
      </mx:DataGrid>

       

      public function close():void {
          PopUpManager.removePopUp(this);
      }

       

      error:

      TypeError: Error #1009: Cannot access a property or method of a null object reference
      at mx.controls.listClasses::ListBase/::mouseIsUp():[ListBase.as:7029]
      at mx.controls.listClasses::ListBase/mx.controls.listClasses:ListBase::m ouseUpHandler():[ListBase.as:7060]
      at mx.controls::DataGrid/mx.controls:DataGrid::mouseUpHandler():[DataGri d.as:4211] ....