BlazeDS / PureMVC et partagé vos
-
30-09-2019 - |
Question
Je construis application modulaire avec 2 modules qui partagent commun vo: ShopRegionVO C'est aussi une vo entité BlazeDS et est associée à un objet java à distance. Lorsque les charges shell tout premier module est ok. Le second module est une liste de ShopRegionVOs et le changement de l'article est traité avec le code suivant:
sendNotification(CoverageConstants.SET_SELECTED_REGION_COMMAND, ShopRegionVO(List(e.target).selectedItem));
L'exception est levée ici:
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
Le ShopRegionVO est dans la bibliothèque Flex séparé qui est partagé entre modules:
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;
}
}
}
La solution
Voici une solution:
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow