« Back

Liferay Client Side Inter Portlet Communication Using Ajax

Technical Blogs January 20, 2014 By Meera Prince

Liferay Client Side Inter Portlet Communication Using Ajax

 
Objective:
 
Achieve inter portlet communication from client side using Ajax and Liferay Java Script.
 
Introduction:
 
Inter portlet communication is way of exchange the data between portlets in the page or portlets which reside in the other pages.
 
In liferay we have different ways we can achieve this one of the way is client side inter portlet communication.
 
Environment:
 
Liferay 6.2 +Tomcat 7.x+MySQL 5.1
 
Note:
 
The code will work for portal 6.2 version you can try for 6.1 too.
 
Download Client Side IPC portlet from following location
 
You can find source and war file
 
 
Portlet Screen:
 
 
 
Procedure for deploy portlet:
 
You can use war file and directly place in your portal deploy folder and test or you can also use source to deploy portlet.
 
Once portlet is deployed successfully you can see the portlet in sample category names as Sender Portlet and Receiver Portlet.
 
Usage Of Portlets:
 
Drag and Drop two portlet in same page and enter email address in sender portlet then click on send button as soon as you click you can see user details in receiver portlet.
 
Client Side Inter Portlet Communication (IPC):
 
Client Side Inter Portlet Communication is one of the ways in IPC   this can apply the portlet which reside in same page. Because Client side IPC will uses java script to communicate that’s why all portlet which participated in IPC need to be in same page.
 
Liferay already have some java script library to implement client side IPC in portlet 
development.
 
The following diagram show you the IPC among Portlets
 
 
Here we have two types of portlets
 
Sender Portlet
Receiver Portlet
 
Go through following link for full source of tutorial
 

http://www.liferaysavvy.com/2014/01/liferay-client-side-inter-portlet.html

Threaded Replies Author Date
Sorry, but I don't think this is an IPC... Léo PRATLONG December 15, 2015 1:12 AM

Sorry, but I don't think this is an IPC process. This is just Ajax communication in a page. It does not answer to the IPC specification (JSR 286).
Posted on 12/15/15 1:12 AM.