我正在构建具有2个模块的模块化应用程序,它们共享共同的vo: ShopRegionVO。这个vo也是一个BlazeDS实体,并被映射到一个远程java对象。当shell第一次加载模块时,一切正常。第二个模块是ShopRegionVO列表,使用以下代码处理商品更改:
sendNotification(CoverageConstants.SET_SELECTED_REGION_COMMAND, ShopRegionVO(List(e.target).selectedItem));异常在这里抛出:
Main Thread (Suspended: Error #1034: Type Coercion failed: cannot convert model.vo::ShopRegionVO@14961809 to model.vo.ShopRegionVO.)
view.list::RegionListMediator/onChange
flash.events::EventDispatcher/dispatchEventFunction [no source]
flash.events::EventDispatcher/dispatchEvent [no source]
mx.core::UIComponent/dispatchEvent
mx.controls.listClasses::ListBase/mouseUpHandler
mx.controls::List/mouseUpHandler ShopRegionVO位于单独的Flex库中,该库在模块之间共享:
package model.vo
{
[Bindable]
[RemoteClass(alias="com.abc.RegionVO")]
public class ShopRegionVO
{
public var name : String;
public var id : int;
public function ShopRegionVO(_id:int=0, _name : String=null)
{
super();
// init properties
name = _name;
id = _id;
}
}
}发布于 2010-04-21 22:07:08
这里有一个解决方案:
http://www.object-factory.org/?p=38
https://stackoverflow.com/questions/2681254
复制相似问题