Just wanted to say taht I've tested getting the nested VO as a single VO, i.e. not nested and it works so the VO itself should be ok.
All of this is handled by the Data/Services functionality of Flash Builder so it's hard for me to debug whats going wrong. All i have is that the Kvitto Variable is undefined...
Still no solution :-)
I'm using Doctrine and have my VO's setup as entitys on the PHP side. Do I need to use any sort of classmapping for this to work? I'm just using the Data/Services features of FLEX to get simple VO's over to FLEX correctly typed. As soon as I try to nest a VO within another I get this error...
When I use the Data/Services to configure the return type for the VO with the nested VO it doesn automatically recognize the VO as i does for simple VO's without any nested VO. If I skip to mapp the nested VO and leave them as objects it's ok, I get the data but then the nestd VO's are not typed.
Are there any differences in how Flash Builder generates the VO's with 4.5 compared to 4?
I'm using Modules, in fact a dynamically loaded module displayed in a TitleWindow. The service call is made from within the module and the VO only exist in the actual module, not the main app. Could it be that this is the reason why the VO is not defined. Taht somehow the serializer is working only against the main app?
In the main App I have successfully made service calls for nested VO's. So I now it can be done...
Really need some help with this, it's driving me nuts
I did it! And I must say all by myself!
Ok. For anyone having the same issue I'll try explain my setup, why it didn't work and how I found a workaround.
My app consists of a main application and a number of modules. All core functionality is kept in the main app such as login and navigation. Each module then does it's own thing, sharing the basic functions from the core with the other modules. Calling for a nested VO from the server works great when within the core, using the core functionality but as soon as any of the modules makes a call like this it fails. Even though I used the Data/Services tab from within the module the Flex serializers look at the valubojects found in the core when trying to type the nested VO's and sice there are no module specific VO's in the core it fails. The simple solution is to copy all the VO's ther super and entity classes over to the core...
I'm not sure but this seems like a bug to me. It's worth mentioning that the package structure for the valueObjects are the same within the core and the modules. Changing the this in the modules might solve this issue but I havent tested it yet.
So, what do you think, is this a bug?
Ok, now I've tested a bit more.
Changing package name for valueobjects in the modules doesn't resolve this issue. Neither does removing optimize module for application, still the same issue. I have to copy all VO's over to the main app and make sure to instantiate them there for this to work. I can live with it but it's a pain, especially since there will be hundreds of VO's and I have to copy them whever I make a change in a VO...
Could there be a issue in how I'm linking the main app and the modules? Now I'm doing the modules as seperate projects instead of within the main app.... In each module I'm referencing the main app in order to use the shared functionality.
Hi Mogge and all others having the same issue,
I was almost going to restructure my app after I successfully tested your solution. However I did try some few steps around yet, and found, that if you declare the VO classes in you main app, the service calls will work in modules as they should. It is not enough to import them, but rather create a dummy variable of each VO class you want to use in modules (no need to instantiate with 'new'). It saved me a lot of a time now although I've killed one night trying to figure it out.
Great that someone could benefit from what I came up with! And thanks for your addition, that will help alot!