user2585890
user2585890

Reputation:

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.

Upvotes: 4

Views: 5411

Answers (2)

Pradip Bhatt
Pradip Bhatt

Reputation: 658

I had same requirement. But i am very new in Liferay... So i have not much more knowledge of Liferay API.

So I used web service for fetch portlet data to another portlet. Its really interesting and very easy..

You can find more help from this.

Jersey RestFul webService

I done this and all working very well.

Thankssssss

Upvotes: 0

Pankaj Kathiriya
Pankaj Kathiriya

Reputation: 4210

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

Upvotes: 2

Related Questions