Foros de discusión

Add NestedPortlets in JSP

j mesa, modificado hace 11 años.

Add NestedPortlets in JSP

New Member Mensajes: 9 Fecha de incorporación: 17/08/10 Mensajes recientes
Hi,
I'm developing a portlet in LR 6.1GA2 and I need to add a nestedPortlets instance in a JSP.
I tryed to use <liferay-portlet:runtime portletName="118" queryString="" /> but it doesn't work (no errors are shown).
If I put "56" instead (WebContentDisplay portlet) it works fine.
What is going wrong?
Thanks!
j mesa, modificado hace 11 años.

RE: Add NestedPortlets in JSP

New Member Mensajes: 9 Fecha de incorporación: 17/08/10 Mensajes recientes
If I active the debug log level it shows "Portlet 118 is instanceable but does not have a valid instance id"
What does it mean?
Abhi M, modificado hace 11 años.

RE: Add NestedPortlets in JSP

Junior Member Mensajes: 28 Fecha de incorporación: 29/02/12 Mensajes recientes
Hi,

you can instantiate portlet as follow:


<%
ThemeDisplay themeDisplay1 = (ThemeDisplay)request.getAttribute(com.liferay.portal.kernel.util.WebKeys.THEME_DISPLAY);
Layout layout1 = themeDisplay1.getLayout();
long plid1 = layout1.getPlid() ;
PortletURL portletURL = PortletURLFactoryUtil.create(request, "portlet_name", plid1, PortletRequest.ACTION_PHASE);
portletURL.setWindowState(WindowState.MAXIMIZED);
%>
<br/>
<a href="<%=portletURL.toString()%>">Click Here To Invoke Portlet</a>

Thanks
j mesa, modificado hace 11 años.

RE: Add NestedPortlets in JSP

New Member Mensajes: 9 Fecha de incorporación: 17/08/10 Mensajes recientes
Hi Abhi,
Thank you, but I don't need a link, I just need to embed the nested portlet in the JSP...
Iñaki Muros Martínez, modificado hace 10 años.

RE: Add NestedPortlets in JSP (Respuesta)

New Member Mensaje: 1 Fecha de incorporación: 17/03/09 Mensajes recientes
Hello j mesa
The correct code is:
<liferay-portlet:runtime portletName="118_INSTANCE_juahKU123456" /> 


It's important that instanceId is valid id (12 chars).

Regards,

Iñaki.
j mesa, modificado hace 10 años.

RE: Add NestedPortlets in JSP

New Member Mensajes: 9 Fecha de incorporación: 17/08/10 Mensajes recientes
Solved!! Gracias Iñaki !!