The Broadcast-Listener design pattern is similar to the Master-Detail pattern. Users can select an item or perform some other action in a "broadcast" portlet, which causes the content in other related "listener" portlets to be redrawn. The major difference is that the Broadcast-Listener pattern relies on the PCC component to raise an event when an action is performed in the "broadcast" portlet. One or more "listener" portlets can respond to this event and update their content accordingly.
Use the Broadcast-Listener adaptive portlet design pattern when there is a loose coupling between portlets. In the example below, the "broadcast' portlet (broadcastlistener_portletA.html) displays a list of prospects. Clicking on a link in the portlet displays information about the prospect in two "listener" portlets (broadcastlistener_portletB.html and broadcastlistener_portletC.html). For more tightly coupled portlet functionality, see the Master-Detail pattern.
To see this design pattern in action, go to the Adaptive Portlets Community on the portal and click Broadcast-Listener.
<!-- jsxml
includes --> <!-- Inline JS helper functions --> // Function that raises an event through
the PCC when a prospect is selected
</script> <!-- The prospect list --> |
<!-- jsxml
includes --> <!-- Inline JS helper functions --> // Function that listens for prospectSelected
PCC events and gets
document.PCC.RegisterForEvent('urn:schemas.plumtree.com:prospect', 'prospectSelected', refreshPortletB); // Function that handles the response
and redraws
</script> <div id="portletBContainer"> |
<!-- jsxml
includes --> <!-- Inline JS helper functions --> // Function that listens for prospectSelected
PCC events and gets
document.PCC.RegisterForEvent('urn:schemas.plumtree.com:prospect', 'prospectSelected', refreshPortletC); // Function that handles the response
and redraws
</script> <div id="portletCContainer"> |
Next: Structured Response