Module loading is asynchronous so you can't "return" something. If the
module class has a method on it that you call the in the ready handler of
the loading app you would call factory.create() then the method and as long
as you didn't store the instance anywhere permanent it would be garbage
collected at some point and the module would unload
what I would like to do is load a module that allows the user to enter
filter criteria and then select records in the data base.
He/she then marks one of the retrieved records in a datagrid and
presses a "Select" button.
The filter/select module should write the record key of the selected
record back to the calling module and control should return to the
I should be able to use the parentApplication specifier to write
the data to a field in the caller. But when I try to get the the
called module to unload using:
parentApplication.TargetModule.url = null;
both modules get unloaded.
Hard to say what the problem is. Remember that parentApplication is not the
same as "parent module". Make sure you have a strong reference from the
main app to the calling module otherwise it might be that the filter module
is the only thing preventing the calling module from being garbage
collected. Also check the code that loads modules to make sure you are
using the applicationDomain parameters correctly.