Apache flex BlazeDS/PureMVC和共享VO
我正在用两个模块构建模块化应用程序,它们共享公共vo:ShopRegionVO 该vo也是BlazeDS实体,映射到远程java对象。当shell加载第一个模块时,一切正常。第二个模块是ShopRegionVO列表,使用以下代码处理项目更改:Apache flex BlazeDS/PureMVC和共享VO,apache-flex,actionscript-3,module,blazeds,puremvc,Apache Flex,Actionscript 3,Module,Blazeds,Puremvc,我正在用两个模块构建模块化应用程序,它们共享公共vo:ShopRegionVO 该vo也是BlazeDS实体,映射到远程java对象。当shell加载第一个模块时,一切正常。第二个模块是ShopRegionVO列表,使用以下代码处理项目更改: sendNotification(CoverageConstants.SET_SELECTED_REGION_COMMAND, ShopRegionVO(List(e.target).selectedItem)); 异常就在这里引发: Main Thre
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;
}
}
}
以下是一个解决方案:
据我所知,这是因为物理上两个SWF模块不共享公共类,但该类存在于第一个和第二个模块中。如何将这两个VO映射到BlazeDS java类?