If you get an runtime exception, always use a debug build and post the
full stacktrace.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of florian.salihovic
Sent: Monday, August 18, 2008 9:30 AM
To: [email protected]
Subject: [flexcoders] ItemRenderer returns empty Object instead of
encapsuled data.

 

I have two instances of mx:controls::List. Both use the same
ItemRenderer. A TypeError 
occours, when i drop one item from one List into the other List. Instead
of the encapsuled 
type (an instance of an interface, typed to the interface) just an empty
Ombject instance is 
returned.

I implement mx.core.IDataRenderer,
mx.controls.listClasses.IDropInListItemRenderer and 
mx.controls.listClasses.IListItemRenderer in my component. Here is the
code for the 
overwritten data and listData Propertys:

private var _item:IPlayListItem;
private var _listData:BaseListData;

[Bindable("dataChange")]
override public function get data():Object {
return this._item;
}

[Bindable("dataChange")]
public function get listData():BaseListData {
return this._listData
}

override public function set data(value:Object):void {
trace("ListItemRenderer.data: "+value);
super.data = value;
if (!value) {
return;
}
if (this._item == value) {
return;
}
if (value is IPlayListItem) {
super.data = IPlayListItem(value);
this._item = IPlayListItem(value);
}
this.dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));

}

public function set listData(value:BaseListData):void {
if (this._listData == value) {
return;
}
this._listData = value;
this.dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
}

What am i missing?

Best regards!

 

Reply via email to