AJAX Made Easy - Learn AJAX



Home AJAX-Design
 

Inter-Portlet Contact in Ajax

 

Developers will frequently have to work with portlets. Portlets are components in a website where information will be released to the browser or to the client side. Every developer whose orientation is in developing websites, will most likely work with portlets. Whatever programming language they may use, they will have to harness portlet component to ensure they are building the application as expected.


Portlets in Ajax

Using portlets is possible in Ajax with a little twist. Different portlets can be launched at the same time with the same browser and with the right coding; they can be used to provide information to the user without any problem. Portlets by definition are geared in providing information to the client side only.


One way communication will not constitute the powerful Ajax based application. The application could provide a lot of information to the user but without admitting additional information from the user and even other portlets, the application may not be interactive for an Ajax based application.


Inter-Portlet Communication

Information from user is easy to integrate in an application. But the challenge is basically on inter-portlet communication. As we have indicated, portlets are only used to direct data to the client side. They are never supposed to be used to communicate with each other.


But the inability to communicate with another portlet is just on paper. There are websites today that rely on inter-communication of portlets for a highly efficient Ajax based applications. In fact, inter-communication of portlets is possible even for applications with different programming language.


There are two ways developers could use to enable communication between portlets in the same page. The first method is the tedious coding experienced developers could do. This is extra challenging in an Ajax based application since developers have to work around different portlets with different coding and infuse them properly for an Ajax based application.


The second (and much simpler) method is the use of APIs. Developers could build an Ajax based application and they can use simple APIs to connect different portlets. They can easily build an Ajax based application right now and just wait for the API later.


Challenge for Inter-Portlet Communication

The common error in inter-portlet communication is in page refresh. In other programming languages except Ajax and JavaScript, developers would have to live with the fact that every time communication happens between portlets, the webpage would most likely to refresh. That is why developers would often shy away from multiple portlets if they are not really necessary.


On the other hand, Ajax and JavaScript applications could easily handle inter-portlet communication. Partial page refresh (PPR) is possible in an Ajax based application. That means only a part of the webpage will be processing data between portlets and the result will be a highly interactive Ajax based application.


Portlets are important for an Ajax based application. Developers could code them manually, use a framework or use an API to harness the power of portlets. Through simple partial page refresh, inter-portlet communication is possible.



Read Next: Optimizing your MVC



 

 

Comments



Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links