Filip Nikolic
Filip Nikolic

Reputation: 47

Liferay inter portlet communication

I'm sorry if this is a stupid question, however after hours of research, I was unable to find a solution to my two issues:

  1. Communication between portlets on the same page (using jsr286, public render parameter). The main problem here is using AJAX for the IPC, so that the communication stays server-side, but the page doesn't refresh.
  2. The second problem I have is, how do I redirect from the first to a second jsp page, while passing a variable back end to the java file of the portlet on the second page?

Any help is appreciated, thanks in advance!

Upvotes: 0

Views: 356

Answers (2)

Filip Nikolic
Filip Nikolic

Reputation: 47

For anyone who is looking for good examples of Liferay portlets, check out this great GitHub repository!

Helped me with my problems out a lot!

Upvotes: 0

tomic
tomic

Reputation: 613

Ad. 1 Have you tried following document explaining idea of IPC Mechanism? (second section of document)

http://www.liferay.com/community/wiki/-/wiki/Main/Portlet+to+Portlet+Communication

Basically idea is pretty simple and I have created some portlets using it back then.

Ad. 2 Correct me if I am wrong, as I understand, you want to pass some parameters while redirection? Well, just pass these parameters to response object in method invoking redirection and you will be able to receive them in your second method. Here is part of code passing some parameters from Action phase to Render phase which is responsible for presenting view result.

    response.setRenderParameter(CURRENT_PAGE_PARAM, currentPage);
    response.setRenderParameter(DELTA_PARAM, deltaParam);
    response.setRenderParameter(ACTION_PARAM, "filterData");

Another idea can be storing your information in session model if this is shared between multiple views.

Upvotes: 1

Related Questions