BlazeDS / PureMVC und gemeinsame vos
-
30-09-2019 - |
Frage
Ich baue modulare Anwendung mit 2 Modulen, die gemeinsam vo teilen: ShopRegionVO Diese vo ist auch eine BlazeDS Einheit und zu einem Remote-Java-Objekt abgebildet. Wenn Shell geladen erste Modul ist alles ok. Das zweite Modul ist eine Liste von ShopRegionVOs und Positionsänderung wird mit dem folgenden Code behandelt:
sendNotification(CoverageConstants.SET_SELECTED_REGION_COMMAND, ShopRegionVO(List(e.target).selectedItem));
Die Ausnahme ist hier geworfen:
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
Die ShopRegionVO ist in separater Flex-Bibliothek, die zwischen den Modulen gemeinsam genutzt wird:
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;
}
}
}
Lösung
Hier ist eine Lösung:
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow