So lets say we have a parent page (parent.jspx with parentPageDef.xml) and region (region.jspx with regionPageDef.xml and regionBean.java) in it, which needs to consume an event published by parent.
1. In parent.jspx create command button which will initiate an event. Then in property pallet find "Contextual Events" and add one with name "MyEvent".
2. Create java interface "MyEventHandler" for classes which will handle events:
3. Create java class "MyEventReceiver" to receive events:
4. Generate data control for "MyEventReceiver":
5. Create RegionBean.java with custom event handler:
6. Add previously created data control binding to regionPageDef.xml:
7. Finally create event mapping in parentPadeDef.xml:
Open event mapper:
Provide event details:
8. Done! Test it! :) Implemented sample application can be downloaded here.