0 Replies Latest reply on Sep 3, 2011 9:31 PM by tooMuchTrouble

    itemRendererFunction firing too fast

    tooMuchTrouble Level 3

      i've got a TitleWindow created as a popup:

       

      if (externalDataWindow)

           PopUpManager.removePopUp(externalDataWindow);

      externalDataWindow=ExternalDataWindow(PopUpManager.createPopUp(this,ExternalDataWindow,fal se));

      externalDataWindow.externalData=externalData;

      externalDataWindow.addEventListener(CloseEvent.CLOSE,cleanUp,false)

       

      externalDataWindow has a spark DataGrid with one column using an itemRendererFunction:

       

      public function whichSymbolStyle(item:Object,column:GridColumn):ClassFactory {

           var cls:Class;

           if (item.geometryType=="Point")

                cls=renderers.pointSymbolRenderer;

           if (item.geometryType=="Linestring")

                cls=renderers.polylineSymbolRenderer;

           if (item.geometryType=="Polygon")

           cls=renderers.polygonSymbolRenderer;

      return new ClassFactory(cls);

      }

       

      this errors w/item being null when i create the ExternalDataWindow. watching debug i can see the whichSymbolStyle method firing off as soon as the popup is created, before the actual data is passed into the component.

       

      is there any way to defer itemRendererFunction from firing or a better way to create a TitleWindow popup & pass in data?

       

      thanks.