Enterprise APP
Binding 에러 이슈 본문
"unable to bind to property 'XXX' on class 'Object'
(class is not an IEventDispatcher)"
on class 'Object'
This problem occurs frequently when transferring complex objects using AMF
when the object returned from the server contains an array or array
collection of more objects.
One symptom of this problem is that it occurs after converting the data
request from an HTTPService call to a Remote Object call.
It turns out that Flex does not handle data returned from the AMF data
service in quite the same way as HTTPService and WebService results. With
these two later services Flex will automatically wrap Arrays in
ArrayCollection and Objects in ObjectProxy wrappers so binding will work.
The solution is to do this same thing manually, with code similar to the
following:
function resultHandler(result:Array) {
for(var i:String in result) result[i] = new ObjectProxy(result[i]);
targetArrayCollection = new ArrayCollection(result);
}
Note: It may be the case that the result object is already an
ArrayCollection yet the Objects in ObjectProxy wrappers. In this case you
only need to include the for loop to implement ObjectProxy for all objects
in the ArrayCollection.
'Flex General > Tips' 카테고리의 다른 글
XMLList(XML) to Array, (0) | 2010.04.01 |
---|---|
Three ways to load image files in Flex (0) | 2010.03.27 |
flex & 마우스 휠 처리 (0) | 2010.03.18 |
FlashBuilder Unit Test locale 오류 (0) | 2010.02.13 |
HSlider, Custom Label, ThumbOverlap ... (0) | 2010.02.05 |
Comments