Forums de discussion

Stuck in obtaining plid dynamically

thumbnail
Arunjyoti Banik, modifié il y a 8 années.

Stuck in obtaining plid dynamically

Junior Member Publications: 74 Date d'inscription: 26/08/14 Publications récentes
Hi all,
In my requirement, there is a portlet A in page 1 and portlet B in page 2. I just need to navigate from portlet A to portlet B. So in portlet A, I used

<liferay-portlet:renderURL var="navTopage" plid="32513" portletName="portletB_WAR_WCSGPortal" >
<liferay-portlet:param name="jspPage" value="/jsps/portletb.jsp"/>
</liferay-portlet:renderURL>

It is working perfectly. But the thing is it is working when I am just hardcoding the plid of portlet B in page 2. For dynamically I used:

<%
ThemeDisplay td =(ThemeDisplay)request.getAttribute(WebKeys.THEME_DISPLAY);
Layout layout = td.getLayout();
long plid = layout.getPlid() ;
%>

<liferay-portlet:renderURL var="navTopage" plid="<%= plid %>" portletName="portletB_WAR_WCSGPortal" >
<liferay-portlet:param name="jspPage" value="/jsps/portletb.jsp"/>
</liferay-portlet:renderURL>

In the browser I can see the url is getting changed but the navigation is not happening. What change is needed for this??

Arun
thumbnail
Amos Fong, modifié il y a 8 années.

RE: Stuck in obtaining plid dynamically (Réponse)

Liferay Legend Publications: 2047 Date d'inscription: 07/10/08 Publications récentes
thumbnail
Arunjyoti Banik, modifié il y a 8 années.

RE: Stuck in obtaining plid dynamically

Junior Member Publications: 74 Date d'inscription: 26/08/14 Publications récentes
Thanks Amos. Worked like a charm and in one go. Right now all our portlets are in a same group. So for the groupId I am giving themedisplay.getScopeGroupId() now. But I think they will soon order us to access specific pages of another portlet placed in a private page of different group. emoticon.

Anyways many thanks for your answer.

Arun