IPC problems between Vaadin Portlets on different Liferay Pages

Hello guys,

We have two
Vaadin 7.0.1
portlets who communicate with each other using
Portlet 2.0 IPC-Events
. These two portlets are on different pages in
Liferay (6.0.12EE)
. We added the required settings to portal-ext.properties to allow distribution of events across pages.

The first portlet (pm12) shows a number of products. When a product is selected and right-clicked, an event is
published
with the selected product as payload for the event.

The second portlet (pm21), which is on a different page,
consumes
this event, retrieves the product from it and shows all the attributes of the selected product in the page.

Not a very difficult use-case I would say!

However, the pm21 portlet only consumes the event (read: enters the processEvent method of PortletListener interface) if the page on which the pm21 is deployed is
accessed
in the browser (by the user) beforehand. This causes the init method of the pm21 portlet’s main UI class to be called, in which the portletlistener is added to the portletSession. After this addition the portlet can handle events. This seems logical.


If the user does not access the page beforehand and the pm12 portlet produces the event , nothing happens in the pm21 portlet, because the processEvent method is not called, because the portletListener is not added to the session, because the init method in the UI is not called!

We are looking for a way around this problem and hope you guys can help. Vaadin 6 does not have this problem (so it seems).

Regards,

Kim Zeevaarders
The Netherlands

Vaadin portlets are actually lazy-initialized. The components do not get created until the user actually lands on the page.

Since the user doesn’t land there, the components are not created and the event listener is not wired up.

Not much of a help, I’m sure, but at least you know why the event is not delivered beforehand.

Hi Dave,

Thx for taking the time to reply :slight_smile:

The reason you mention is logical and the only explanation for the problem we are facing

However, we are looking for a way around this! Are you saying the desired behaviour, which in fact is enabling IPC between two Vaadin portlets on different pages, is impossible to implement?

Furthermore, in Vaadin 6 the problem does not occur. When I fire an event from a (non-vaadin) portlet by calling ActionResponse.sendEvent the consuming Vaadin 6 portlet (deployed on different page) first gets its init() method called before the handleEvent method is called…

How is it possible that this works in Vaadin 6 but not in Vaadin 7?