Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Data modeling with multiple Flex modules not working

Avatar

Former Community Member

Data Modelling with multiple Flex modules not working.

I am having two modules in my application.

a) Customer (Customer Module is loaded when application is started)

b) Order

Each module has data service which is generated using data modelling

Customer module can get data from Livecycle data services as it is loaded when application is started

So after getting information from Livecycle data service, if I execute Order module then I get following error

Error: Unable to initialize destination: Test.MaintainOrderBean added after data store has been initialized

at mx.data::DataStore/http://www.adobe.com/2006/flex/mx/internal::addDataService()[C:\depot\DataServices\trunk\frameworks\projects\data\src\mx\data\DataStore.as:1991]

If after application startup, if I click on Order module and make call to MaintainOrderService then in this case I get data from OrderService. ( if this call is made before making call to get customer data)

4 Replies

Avatar

Employee

Hi. Are you still having problems with this? How are you loading your modules?

There are some things you need to be aware of when loading LCDS applications as sub apps into a parent application.

In most cases you will want to use SWFLoader instead of ModuleLoader. When using SWFLoader you need to set the loadForCompatibility property to true. You will also need to use the new 10.1 Flash player. If you need to support older versions of the player, there are a couple of workarounds that are possible.

I describe these in more detail in my comments to the following bug.

https://bugs.adobe.com/jira/browse/BLZ-413

Take a look at my comments and see if that helps you. If that doesn't solve your problem let me know by replying to this forum posting. Thanks.

-Alex

Avatar

Former Community Member

@Alex excellent workaround. Just one question, when using SWFLoader, how can you get an object/method from the parent (main) application. In module I can use parentApplication.methodName, but it does not work if SWFLoader. Any ideas?

Avatar

Level 1

I had the same error (but only with a single module loaded). It turned out I forgot to add the identity property in my destination.

<metadata>
  <identity property="id_proxy"/>
</metadata>

Hope it helps