Huray, got it working. But I am still not quite happy about it. Let me share the sollution and hope someone comes up with a better one.
My first module on the page is a grid displaying my records. When I click on a record and the setting of the module is to use a form, it broadcasts the action using the ModuleCommunication event, which in effect triggers the second module, my form, to display the record.
The main problem I was facing is the following code:
if
(ModuleCommunication != null)
ModuleCommunication(this, oArgs);
If there is a subscription on the event, it fires the event. Great, but ModuleCommunication was null, and so the event never fired (just fire it, leads to an error :) )
The solution was the order of modules (to damn simple, to try the first time :D:D:D) When I place my grid first in the center pane and the form beneath it on the center pane, the ModuleCommunication event is not subscribed by the form in the PostBack. It first executes the grid and handles it events, then it renders the form and handles its events.
When I first place the form control, it is rendered, handles the events and registers to the ModuleCommunication Event. The second control, the grid, is rendered, handles the event, namely fires up the ModuleCommunication event. Because the first control is registered to the event, it executes the event handler.
So, wrapping it up: The order of modules is essential in handling the ModuleCommunication event. Sad but true (to qoute one of my favorite bands). First use the receiver module on the page, after that you can use the sender module. Perhaps something could be thought if for a next release. For instance, first render all modules and let them register to the event and only fire the event after that event.
greetz,
Patrick Baanvinger