Foren

Liferay event lost between portlets when deploying shared scripts

Loc Le, geändert vor 12 Jahren.

Liferay event lost between portlets when deploying shared scripts

New Member Beiträge: 3 Beitrittsdatum: 04.11.11 Neueste Beiträge
Hi all,
I am using liferay 6.0. I am testing a situation where there 2 portlets.
portlet1 fires an event in javascript, namely:
Liferay.fire("event1", someData);

portlet2 registers and handles this event as below:
Liferay.on("event1",
function(event, data){
alert(" event caught");
// process data here.
});

This code works correctly in liferay environment. That is event1 is fired by portlet1, and is caught and processed by portlet2.

The problem is event1 is lost when I deploy the scripts of these 2 portlets ( use Configure -> Sharing, then copy the script code) to an html file and load the file.
I see that event1 is still fired by portlet1, but portlet2 does NOT catch it as in t he liferay environment.

Do you have any ideas?

Thanks
Loc
thumbnail
Ravi Kumar Gupta, geändert vor 12 Jahren.

RE: Liferay event lost between portlets when deploying shared scripts

Liferay Legend Beiträge: 1302 Beitrittsdatum: 24.06.09 Neueste Beiträge
If I am not wrong, you are trying this in different browser tabs/windows..?? In that case it will not work since its just javascript and purely client side..
thumbnail
Ravi Kumar Gupta, geändert vor 12 Jahren.

RE: Liferay event lost between portlets when deploying shared scripts

Liferay Legend Beiträge: 1302 Beitrittsdatum: 24.06.09 Neueste Beiträge
Also.. after sharing IPC will work or not I have no idea.. emoticon