Skip to main content
SunilRana_Gateway
Inspiring
August 28, 2012
Answered

Warning Unable to bind to Property "somevar" on object 'Object' class is not an IEventDispatcher?'

  • August 28, 2012
  • 3 replies
  • 2270 views

Hi All,

     How to resolve below warning:

Warning Unable to bind to Property "somevar"  on object 'Object' class is not an IEventDispatcher

Thanks,

Sunil Rana

This topic has been closed for replies.
Correct answer SunilRana_Gateway

Hi Paul,

I got solution  from net & below is soltuion

Cast the data in your itemrenderer as an objectProxy.

itemRender.mxml

<?xml version="1.0" encoding="utf-8"?>

<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"

     verticalScrollPolicy="off"

     horizontalScrollPolicy="off"

     creationComplete="init();">

     <mx:Script>

          <![CDATA[

             import mx.utils.ObjectProxy;        

             [Bindable]
             public var dataProxy:ObjectProxy;

             private function init():void {
                 dataProxy = new ObjectProxy(data);
             }
         ]]>
     </mx:Script>

     <mx:Image source="{dataProxy.image}" height="65" />

</mx:HBox>

Thanks,

Sunil Rana

3 replies

Participating Frequently
August 28, 2012

The only solution is to use a property of an object that is an IEventDispatcher, rather than a property on a generic object. For example, you could make the property a variable in an MXML file, or create a class that implements IEventDispatcher. In either case I think you then must mark the property with the [Bindable] metatag so that the data binding code gets generated.

SunilRana_Gateway
Inspiring
August 29, 2012

Hi Paul,

Can you provide example of it so it will good to understand.

Thanks,

Sunil Rana

SunilRana_Gateway
SunilRana_GatewayAuthorCorrect answer
Inspiring
September 7, 2012

Hi Paul,

I got solution  from net & below is soltuion

Cast the data in your itemrenderer as an objectProxy.

itemRender.mxml

<?xml version="1.0" encoding="utf-8"?>

<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"

     verticalScrollPolicy="off"

     horizontalScrollPolicy="off"

     creationComplete="init();">

     <mx:Script>

          <![CDATA[

             import mx.utils.ObjectProxy;        

             [Bindable]
             public var dataProxy:ObjectProxy;

             private function init():void {
                 dataProxy = new ObjectProxy(data);
             }
         ]]>
     </mx:Script>

     <mx:Image source="{dataProxy.image}" height="65" />

</mx:HBox>

Thanks,

Sunil Rana