Message Boards

Liferay removing public render parameters.

Sid L, modified 13 Years ago.

Liferay removing public render parameters.

Junior Member Posts: 28 Join Date: 12/3/10 Recent Posts
I Have two portlets (each in a different project/war), EmployeeDetails and AddressDetails.
On the jsp page rendered by EmployeeDetails I have a link which will take me to the address details. I am also passing the id to the AddressPortlet.
This id is set as a public render parameter in the AddressPortlet.
Now In the AddressPortlet I retrieve the render parameter as

request.getPublicParameterMap().get("userid")
Since request.getPublicParameterMap() returns a String array,is there any way of finding out which user id is associated with which request?

Now what I want to do is once the address information is processed I want to remove it from the public renderparameter map so that it does not affect the other requests coming to AddressPortlet.

One quick solution could be have the key in the publicRenderParameter unique to a session, but for this is it possible to have a dynamic name for public render parameter in the portlet.xml?

Is there any way how this can be addressed?
Venkat Koppavolu, modified 13 Years ago.

RE: Liferay removing public render parameters.

Junior Member Posts: 85 Join Date: 7/26/10 Recent Posts
Once the address information is rendered/ processed depending on the renderparamters for that request

1. You can set paramters map to null
actionResponse.setRenderParameters(null);

2. Use LIFERAY_SHERED_ key

Write a SerivePreAction Hook and prepare your SharedParametersMap which can be shared to that request and put it into portletSession.

if there is no paremeters to u r request SharedParametersMap will be null.

In other portlet(might be in same WAR or different WAR), u can try to review by using APPLICZATION_SCOPE.
thumbnail
Enrique Valdes Lacasa, modified 3 Years ago.

RE: Liferay removing public render parameters.

Junior Member Posts: 92 Join Date: 7/29/14 Recent Posts
Not sure if this could be of help, but the LiferayPortletUrl class offers the
setCopyCurrentRenderParameters
method:
liferayPortletURL.setCopyCurrentRenderParameters(false);

which allows choosing if clearing the render parameters.