Norman
Norman

Reputation: 2361

Vaadin and Liferay IPC Out of Sync error

I'm using 2 Vaadin Portlets on the same page in Liferay. The first one shows a Table of entries and each row has a button to show details about this entry.

When the button is clicked an IPC event is send which is received by the second portlet, which then switches also to a table view showing the content.

By clicking a close button on the first portlet, the second one will receive again an IPC Event and go back to its original state, which is a blank view that has only the Liferay IPC listener attached to it.

My problem is that after the third click I get an out-of-sync error by Liferay. When the view is changed I always attach it to the main window. So I don't create additional windows that have the same name.

When I use only one portlet on the page I can switch back and forth without any problem. Could it be that the at some point the browser want to fire an event on the client side, but the IPC is already gone on the server side ?

Its really hard to determine the root of this problem.

Upvotes: 0

Views: 514

Answers (1)

eeq
eeq

Reputation: 2118

You are on the right track. IPC works on client side and out-of-sync is caused by non existing component being called from the client to the server.

There might be a few thins causing this, but some scenarios to check:

  • You say you have a close button that clears the display. Calling Application.close() maybe? This actually might cause a new (server-side) application instance to created and called instead of the original.
  • You might be creating a new instance of the IPC component, but the old one is still registered and tries to send something (to its non-existing server part).
  • JavaScript timing issues could cause the IPC events to be sent in different order that you might expect. I see this unlikely if it the behavior is always consistent, but still a possibility.

Hope this helps you to narrow down the case a bit and find a solution. Keep this question updated.

Upvotes: 0

Related Questions