Message Boards

liferay 7: how to navigate from one portlet to other with parameters

Gopal Prasad Satapathy, modified 3 Years ago.

liferay 7: how to navigate from one portlet to other with parameters

Junior Member Posts: 51 Join Date: 3/29/18 Recent Posts
Hello,

I have two MVCportlets portletA & portletB on 2 different pages within a site. 
On clicking of a link in portletA i want to go to  portletB and also need to pass on some parameters that would be available in render method of portletB or from the jsp of portletB. Using DXP 7.1.
 Please suggest the ideal way to achieve this.

Thanks,
Gopal
Gopal Prasad Satapathy, modified 3 Years ago.

RE: liferay 7: how to navigate from one portlet to other with parameters

Junior Member Posts: 51 Join Date: 3/29/18 Recent Posts
Using following inside processAction for redirection, but how can i passon the  attribute val ues as well?

String friendlyURL = "/my-doc";
         boolean isPrivateLayout = Boolean.TRUE;
         long plid = 0;
        try {
            plid = LayoutLocalServiceUtil.getFriendlyURLLayout(themeDisplay.getScopeGroupId(), isPrivateLayout, friendlyURL).getPlid();
        } catch (PortalException e) {
            e.printStackTrace();
        }
        PortletURL redirectURL = PortletURLFactoryUtil.create(PortalUtil.getHttpServletRequest(actionRequest), "mydocuments", plid, PortletRequest.RENDER_PHASE);    
 actionResponse.sendRedirect(redirectURL.toString()); 
thumbnail
Jithin Krishnan, modified 3 Years ago.

RE: liferay 7: how to navigate from one portlet to other with parameters

New Member Posts: 8 Join Date: 11/14/13 Recent Posts
Hi Gopal,
IPC (inter portlet commuication) can be implemented using Public Render Paramter , the following blog entry does provide an example. Hope it helps to achieve your reuirement. https://liferay.dev/blogs/-/blogs/making-portlet-support-public-render-parameter-in-dxp
Best regards,
Jithin Krishnan 
Gopal Prasad Satapathy, modified 3 Years ago.

RE: liferay 7: how to navigate from one portlet to other with parameters

Junior Member Posts: 51 Join Date: 3/29/18 Recent Posts
Thanks Jithin for your response.
Will it work if my portlets are in different pages? i am still struggling. Could you please share some example wheere it works if the portlest are on different pages as well.

Thanks