flexcoders  

[flexcoders] Re: itemRender Debug Warnings

jmfillman
Thu, 26 Jun 2008 15:47:50 -0700

I totally missed the last post or two on this topic, but I still need 
to resolve this.

The full warning message looks like this, each time the itemRenderer 
is used:

warning: unable to bind to property 'display' on class 'Object' 
(class is not an IEventDispatcher)

warning: unable to bind to property 'toolTip' on class 'Object' 
(class is not an IEventDispatcher)

The itemRenderer looks like this:

<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"; width="80" 
height="18" verticalScrollPolicy="off" horizontalScrollPolicy="off">
        <mx:Label text="{data.display}" height="100%" width="100%" 
buttonMode="true" fontSize="9" color="#535353" 
toolTip="{data.toolTip}" textAlign="center"/>
</mx:Canvas>

My list is defined like this:

<mx:List id="lstD0" left="0" top="15" right="0" bottom="0" 
editable="false" horizontalScrollPolicy="off" 
itemRenderer="myComponents.myItemRenderer" dataProvider="[]"/>

The data coming back from the RO call is assiged to the 
ArrayCollection like this:

private function onResult(event:ResultEvent):void {
     myArrayColl.source = event.result as Array;
}

I loop through myArrayColl and addItems to the list dataProvider 
based on certain criteria.