Blazeds/pureemvc和共享VOS
-
30-09-2019 - |
题
我正在使用2个模块构建模块化应用程序,这些模块共享共同的VO:ShopRegionvo此VO也是一个燃烧的实体,并映射到远程Java对象。当Shell加载第一个模块时,一切正常。第二个模块是ShopRegionVos的列表,并使用以下代码处理项目更改:
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;
}
}
}
解决方案
这是一个解决方案:
不隶属于 StackOverflow