0
votes

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!

2
For next time: Please don't ask two questions at once. That way it helps the people answering your question and also others hunting for at least one of your questions.Tobias Liefke
HI @TobiasLiefke thanks for the tip! I was aware of that, however due to the fact that the common topic is inter portlet communication and there is very poor documentation on Liferay in general, it might be beneficial to have two similar questions answered in one place.Filip Nikolic

2 Answers

1
votes

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.

0
votes

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!