Post Reply 
Author event linkage between submoduleControllers
kanwar
Member

Find all posts by this user
Quote this message in a reply
Default  18 February 2014 18:14
Hello,

I have multiple submodule Controllers and i am raising the event in one submodule and want to listen to it in another submodule. How is it possible to achieve it. Or if not possible, any workaround possible.

Regards,

Kanwar
Olaf
Administrator

Find all posts by this user
Quote this message in a reply
19 February 2014 14:52
Hi there!

Your question is a typical app design pattern using AT (that we probably should document better.)

So, when you have multiple modules in your app, communication works as follows:
- parent controllers can call children controllers directly
- children controllers are unaware of what happens around them but can either: modify data in the model or raise events.

If you choose to work with events, the most common pattern is to have a parent controller that acts as an orchestrator for his children. Practically, that means having this global parent listen to all children events and call whatever other child accordingly.
You could also work with a dedicated part of the data model that could be shared among children controllers and use listeners to react to changes.

Hope that helps.
Post Reply