The easiest way to implement communication between portlets is by adding event handlers to your portlet by using the Portlet Event Handlers dialog box in WebLogic Workshop. These handlers will listen for events on any portlet in your application and react to those events as required. This tool allows you to visually add event handlers to your portal applications without the need to do any actual coding in your source files. This is the recommended way to implement interportlet communications with WebLogic Portal.
Note: You should avoid having multiple portlets fire incompatible actions when listening on the same event. For example, a poor portal design would be to have two portlets which are both instructed to maximize when a given event happens (or which both cause page change events).
For more information on interportlet communications and WebLogic Portal, please refer to the Interportlet Communications Guide.
To Implement Interportlet Communications by Using WebLogic Workshop:
Note: Before starting this procedure, ensure that WebLogic Workshop is running and you have a portlet displayed in the design view.
Event detail fields for the selected event appear in the right portion of the Portlet Event Handlers dialog box and the event type will be listed in the Events: list box and as the detail panel label.
These conditions are optional; if you do not check either or both of them, the event handler will listen to events on all portlets in the application.
Selecting a non-specific portlet identified by a value of None,
This, or Any (where None
means not to listen to any portlets, This means to
listen to this specific portlet only, and Any means
to listen to any portlet in the application.
To select the portlet this way, open the Listen to:
drop-down menu and select None, This,
or Any.
The portlet description label appears in the Listen To: list box.
OR
The portlet description label appears s in the Listen To: list box.
In this example, portlet_5_1 is the description label for remoteTest.portlet.
The event (or events) determine the action that a portlet takes when an
event is handled. An event handler can have any number of fire event children.
Only the Portal Event Handler will display existing events, as shown in
the image above. These events are:
This event... | Fires an action when the portlet... |
onActivation | Becomes visible. |
onDeactivation | Ceases to be visible. |
onMinimize | Is minimized |
onMaximize | Is maximized |
onNormal | Returns to its normal state from either a maximized or minimized state |
onDelete | Is deleted from the portal. |
onHelp | Is in the help mode |
onEdit | Is in the edit mode |
onView | Is in the view mode |
onRefresh | Is refreshed |
In this example, the selected action is Change Window State (note that the action name is added to the Events list and is used as the detail label).
The The Portlet Event Handlers dialog box closes and the event handler just added appears in the Properties Editor.
Portal Key Concepts and Architecture
How Do I: Establish Interportlet Communication Programatically?
Developing Portal Applications