3
votes

I have two public pages, each having a portlet.

For the first portlet, on click of a button, I want to open up the other portlet.

Is there any simple way to do this in liferay 6.2?

So far, I tried - Currently from the group/game/portal page ->

<script>
function manageGame() {
    response.sendRedirect('group/games/manage');
}
</script>

<button onClick="manageGame()">Manage</button>
1
If you just want to redirect to other page then in javascript function write window.location.href= "/group/game/portal"Pankaj Kathiriya

1 Answers

1
votes

Either you can create URL in controller and pass it to JSP as below

PortletURL liferayURL = PortletURLFactoryUtil.create(renderRequest,<<portlet-name>>, <<Plid>>,PortletRequest.RENDER_PHASE);
renderRequest.setAttribute("anotherPortletUrl", liferayURL);

JSP click here

OR You can create Liferay Portlet Render URL in JSP as below

<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %>
<liferay-portlet:renderURL plid="10180" portletName="portlet-name" var="openForm" windowState="<%=LiferayWindowState.POP_UP.toString()%>"></liferay-portlet:renderURL>

With above two methods you can create a url on click of which portlet on other page will be opened.

If you portlet is instanciable add instance with portletname