I know that you can create portlets that can refresh its content without refreshing the whole portal page by simply using the JSR286 resourceURL tag and doing an AJAX call.
My question is, is it possible to do an AJAX call in Portlet A and somehow target and dynamically update Portlet B instead?
The idea is to avoid the who portal page refresh (re-rendering) when you do inter-portlet communication via actionURL or events.
You may use jQuery trigger() and bind() methods to communicate between portlets. With this approach all communication will happen on clientside (browser) without any server interaction.
The portlet B that listens to the event should do something like:
$(document).bind("myevent", function(event, param) {
// do your work here
alert("message recieved with data " + param);
});
The portlet A that fire the event should do the following:
$(document).trigger("myevent", "mydata");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With