I'm playing with nested modules and noticed that when you call a
module B from within module A, event.getCurrentModule() returns Module
A from within Module A.
Another thought... Right now when you call a module with runEvent()
the view the module sets is the view that is requested from the host
application (meaning the runEvent returns the event, THEN the view is
rendered on the host application and the path doesn't match the
module's).
It would be kickass if the runEvent() on a module called the view in
the context of the module that set the view. I can post a test case
if needed, this would be a big feature. Without the view rendering I
think modules act too much like what I would expect plugins to do.
This would be a really cool feature, let me know if I need to
elaborate on it.
What I am working towards is building modules as widgets, and saving
the output as a partial that is rendered in the host app's layout. So
for example one page might have 3 RSS readers widgets on it. Each one
has different settings, url to the feed, how many items to display,
etc... Each saves the output to a webpart and the host app renders
that web parts in the app's template.
Not necessarily, remember that the event.getCurrentModule() reacts via the event object which models a user’s request not internal event chains. If not, it would be like switching context.
The module I am calling with runEvent() sets the event view but the
renderer tries to find the view relative to the host application and
not from the module that set it. Still getting up to speed with
modules and trying to figure out the best way to call multiple modules
in a single request. As you mentioned before, there is only a single
request context in ColdBox so this is going to be difficult.