Apache – Unable to select custom item renderer (flex)

apache-flexflex3

Hi I have made the following item renderer in mxml, but when I use it in a list for some reason I can not select it.
Am I doing something wrong?

<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"
horizontalScrollPolicy="off">
<mx:Script>
<![CDATA[
import com.pbsmedia.kanpeki.domain.calEvent.CalEventType;
[Bindable]
private var calEventType:CalEventType;
override public function set data(value:Object):void
{
if(value != null)
{
calEventType = value as CalEventType;
colorBar.setStyle("backgroundColor", calEventType.eventColor);
}
}
]]>
</mx:Script>
<mx:Image source="{calEventType.icon}" />
<mx:Label text="{calEventType.name}" selectable="true"/>
<mx:HBox height="100%" width="100%" horizontalAlign="right" paddingRight="20">
<mx:Box id="colorBar" width="50" height="100%" >
</mx:Box>

The renderer is set up on creation complete of the list's parent component as
follows.

private function cc():void{
if(_itemRenderer != null)
{
lt.itemRenderer = getItemRendererFactory();
}
}
private function getItemRendererFactory():ClassFactory
{
return new ClassFactory(_itemRenderer);
}

I can't see any reason why I can't select it, any pointers much appreciated.

Best Answer

Sorted this. I was forgetting to call super.data = value in the override.

Related Topic