English (United Kingdom)
English (United States)
IPC problems between Vaadin Portlets on different Liferay Pages
等级: Junior Member
We have two
portlets who communicate with each other using
Portlet 2.0 IPC-Events
. These two portlets are on different pages in
. 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
with the selected product as payload for the event.
The second portlet (pm21), which is on a different page,
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
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).