title: Dispatch event from ItemRenderer to Datagroup
body: <p>Eventdispatching here we are again... </p>
  
  <p>I'm trying to dispatch a custom event from an custom ItemRenderer inside a Datagroup with no success.</p>
  
  <pre><code>// CUSTOM EVENT
  import flash.events.Event;
  
  public class CategoryEvent extends mx.events.MenuEvent
  {
      public static const UPDATE:String   = "UPDATE_CATEGORY";
      public var categoryId:Number;
  
      public function CategoryEvent(type:String, categoryId:Number)   
      {
          this.categoryId = categoryId;
          super(type, true, false);
      }
  
      override public function clone():Event
      {
          return new CategoryEvent(type, categoryId);
      }
  }
  </code></pre>
  
  <hr>
  
  <pre><code> // Main Class
  
  &lt;s:Application  xmlns:fx="http://ns.adobe.com/mxml/2009"
                  xmlns:s="library://ns.adobe.com/flex/spark"
                  xmlns:mx="library://ns.adobe.com/flex/mx" 
                  creationComplete="init()"&gt;
  
      &lt;fx:Script&gt;
              &lt;![CDATA[
              // All my imports here 
  
              private function init():void
              {   
                  this.addEventListener(CategoryEvent.UPDATE, updateCategories);
                  this.tree.addEventListener(CategoryEvent.UPDATE, updateCategories);
              }
  
              private function updateCategories(event:CategoryEvent):void
              {
                  //IS NEVER CALLED - DONT KNOW Y
              }
              ]]&gt;
      &lt;/fx:Script&gt;
  
      &lt;s:DataGroup id="tree" dataProvider="{this.getCategorysChildrenResult.lastResult}" itemRenderer="components.Category"&gt;&lt;/s:DataGroup&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>// Custom Item Renderer
  &lt;s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
                  xmlns:s="library://ns.adobe.com/flex/spark" 
                  xmlns:mx="library://ns.adobe.com/flex/mx" &gt;
      &lt;fx:Script&gt;
          &lt;![CDATA[
              import ...events.CategoryEvent;
              import ...valueObjects.Category;
              import flash.events.EventDispatcher;
  
  
              protected function update(id:Number):void
              {
  
                  var categoryEvent:CategoryEvent = new CategoryEvent("UPDATE", data.id);
                  // tried all variations...
                  dispatchEvent(categoryEvent);
                  owner.dispatchEvent(categoryEvent);
                  parent.dispatchEvent(categoryEvent);
                  parentApplication.dispatchEvent(categoryEvent);
  
              }
  
  
          ]]&gt;
      &lt;/fx:Script&gt;
  
      &lt;s:Group&gt;
          &lt;s:BorderContainer&gt;
              &lt;mx:Text buttonMode="true" text="{data.name}"  /&gt;
              &lt;s:BorderContainer click="{this.update(data.id)}" buttonMode="true" /&gt;
          &lt;/s:BorderContainer&gt;
      &lt;/s:Group&gt;
  &lt;/s:ItemRenderer&gt;
  </code></pre>
  
  <p>From what i saw in the debugger, the events are dispatched from the ItemRenderer, but they never get catched by the listener (listener handler is never called). Many suggestions fly around about that in stackoverflow, but most for older flex versions or not practicle for my scenario.
  Can anyone help?</p>