elepil
asked on
Getting a runtime warning message, not sure how to get rid of it
I am getting this runtime warning message:
"warning: unable to bind to property 'code' on class 'Object' (class is not an IEventDispatcher)"
It happens when my datagrid change handler is called, and the code is as follows:
private function dgChangeHandler(event:Even t):void
{
txtCode.text = event.target.selectedItem. code;
}
Whenever I click a selection on the datagrid, that single line in the handler is the one causing the warning message to come up. (txtCode is a mx:TextInput).
Why is this warning coming up, and what can I do to get rid of that warning?
"warning: unable to bind to property 'code' on class 'Object' (class is not an IEventDispatcher)"
It happens when my datagrid change handler is called, and the code is as follows:
private function dgChangeHandler(event:Even
{
txtCode.text = event.target.selectedItem.
}
Whenever I click a selection on the datagrid, that single line in the handler is the one causing the warning message to come up. (txtCode is a mx:TextInput).
Why is this warning coming up, and what can I do to get rid of that warning?
ASKER
The dataProvider is an ArrayCollection object, and the selectedItem does have a child node "code". In fact, the application works perfectly as expected.
This is not the first time I got this warning message. In fact, I was able to get rid of it when I wrapped objects in ObjectProxy objects by passing the object to the ObjectProxy constructor. But in this case, I can't do that because "code" is of type string, and I don't know how to get rid of it.
This is not the first time I got this warning message. In fact, I was able to get rid of it when I wrapped objects in ObjectProxy objects by passing the object to the ObjectProxy constructor. But in this case, I can't do that because "code" is of type string, and I don't know how to get rid of it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What the dataProvider for datagrid? Mostly the selectedItem xml( or what ever be the dataProvider) wont be having a child "code" node.
Thanks,
Vindys