Search code examples
javajspliferay-6portlet

How to call one portlet from another portlet in Liferay?


I have created 3 portlets (testimonial portlet, directory portlet, polling portlet), and I want to call testimonial portlet from directory portlet. How to do this? Kindly help me.

I have written the following code in my view.jsp file of directory portlet:

<%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %>

<liferay-portlet:renderURL var="linkURL" portletName="testi" windowState="maximized" />
<br>
<a href="<%= linkURL%>">Testimonial</a>

I can redirect in another page, but I got error like

This portlet has been undeployed. Please redeploy it or remove it from the page.

Should I make changes in liferay-portlet.xml? Kindly help me.


Solution

  • portletName attribute value , you specified seems incorrect. Thats the reason, you are getting that message. I just checked giving incorrect name "test" as portletName whereas there isnt any portlet with name test.

    If <portlet-name>test</portlet-name> is the entry in your liferay-portlet.xml , then give portletName as test_WAR_testportlet, it will work.

    If other portlet is Liferay's Out of Box portlet, you can utilize PortletKeys class.

    HTH