Creating wire between portlets on the same page

A wire allows two or more portlets to transfer information so that an action, publishing event, or click in a source portlet automatically triggers an action or event and updates the display in the target portlet. As a result, multiple portlets can be updated simultaneously when information is changed. You can create wires only between cooperative portlets and portlets that define events, that is portlets that have been developed to share information with other portlets

source portlet
The portlet that sends the information to other portlets. You can only select those portlets on the page as source portlets that provide information for other portlets.

target portlet
The portlet that receives the information from the source portlet. Only portlets that can process the information sent by the source portlet are shown.

If you have both source and target portelt on the same page then you create wire between them by clicking on Edit Page Layout and going to Wires tab.



On this tab first open the source portlet combo, it will select all the portlets that can act as source. Select the portlet that you want to create wire for.
It will populate the sending combo to list out all the events that this portlet can pulish, select the appropriate event
At this point if you have the target on the current page it will populate the target page combo with name of the current page. Keep the default and select name of the target portlet in Target Portlet combo.
It will populate the Receiving combo with all the matching events that target portelt can receive. Select the appropriate receiving event.

The Wire Type combo has two choices

  1. Private: You want to create a private wire that wont be available to other users on the page

  2. Public: You want this wire to be available to every one.



Important Note: Creating wire requires customizing the page so user must have minimum "Privileged User" role to create wire. If your Privileged user then the wire that you created would always be private to you. You need role editor and above to create public wire

If you want you can download the sample application that has both source and target portlet from here. Create wire between source and target like this.

No comments: