Foros de discusión

IPC Eventing not working on cross page

Debopam Mitra, modificado hace 7 años.

IPC Eventing not working on cross page

Junior Member Mensajes: 39 Fecha de incorporación: 27/09/12 Mensajes recientes
I have Portlet A, Portlet B & Portlet C. Portlet A is in Page 1 and Portlet B & Portlet C is in Page 2.
I have implemented IPC Eventing. In this scenario Portlet A, Portlet B are the Producers & Portlet C is Consumer. Now when ever I am producing data from Portlet B to Portlet C. Let say the I am sending userId from Portlet B to Portlet C and it is working absolutely fine. But in the case of Portlet A to Portlet C which is in the two different pages, I am able to consume the userId in the ProcessEvent function of Portlet C but by the time I am going to the render method of Portlet C the userId is setting to null.

For your reference -
1. I have set portlet.event.distribution=layout-set for cross page eventing.
2. I am sending the data from Portlet A as
/* This from the actionMethod in Portlet A */
QName qName = new QName("http://mysite.com", "userId", "x");
actionResponse.setEvent(qName, String.valueOf(userId));
actionResponse.sendRedirect("/page2"); // I am redirecting because I had to move from page 1 to page 2

3. I am receiving the data in Portlet C @ProcessEvent annotate method. Trust me I double-triple checked my logging.

But during rendering of the Portlet C I am loosing the data.
On the other hand since Portlet B and Portlet C are in the same page, the mechanism is working absolutely fine.
Can any one suggest what might be the problem?

Thanks,
Deb
thumbnail
Olaf Kock, modificado hace 7 años.

RE: IPC Eventing not working on cross page

Liferay Legend Mensajes: 6403 Fecha de incorporación: 23/09/08 Mensajes recientes
Debopam Mitra:
3. I am receiving the data in Portlet C @ProcessEvent annotate method. Trust me I double-triple checked my logging.

But during rendering of the Portlet C I am loosing the data.
On the other hand since Portlet B and Portlet C are in the same page, the mechanism is working absolutely fine.
Can any one suggest what might be the problem?


While I generally consider IPC as a UI layer technology and would (myself) not rely on eventing across pages (thus I'm not sure if my answer will help you): You might need to change layout.default.p_l_reset as well.

From its documentation in portal.properties:
Set the default value for the "p_l_reset" parameter. If set to true, render parameters are cleared when different pages are hit. This is not the behavior promoted by the portlet specification, but is the one that most end users seem to prefer.