You can register listeners on the FlexXBEngine for the postDeserialize
event; FlexXB triggers some events to signal various steps in the
processing flow: preserialize, postserialize, predeserialize and
postdeserialize. In the handler, which gets called after each object
is deserialized you can then check if the object is of type
ApplicationVO and then set the job on it:
FlexXBEngine.instance.addEventListener(XmlEvent.POST_DESERIALIZE,
postDeserializehandler);
//or this if you do not use the easy access instance
//flexxbInstance.addEventListener(XmlEvent.POST_DESERIALIZE,
postDeserializehandler);
private function postDeserializehandler(event : XmlEvent) : void{
var result : Object = event.object;
if (result is ApplicationVO) {
ApplicationVO(result).job =
ModelObjectCache.instance.getObject(ApplicationVO(result).value,
JobVO) as JobVO;
}
}
Something like this should work. Check it though, as I did not write
it in a project but rather directly here. :D
Hope it helps,
Alex