Foros de discusión

How to get the namespace of another portlet?

thumbnail
Raymond Gardner, modificado hace 12 años.

How to get the namespace of another portlet?

Regular Member Mensajes: 118 Fecha de incorporación: 15/07/11 Mensajes recientes
Is it possible to get the namespace, as with <portlet:namespace/>, for another portlet?

Say portlet A needs to access/control a div in portlet B. Can portlet A get a handle to portlet B's namespace so portlet A may uniquely identify the div in portlet B?
I realize this creates a dependancy. That is going to happen. I'm trying to get portlet A to do the navigation for the content in portlet B.

I could just hardcode the values but I'd like to keep it flexible.

Or, do I have to use IPC and event handling for this?
thumbnail
jelmer kuperus, modificado hace 12 años.

RE: How to get the namespace of another portlet?

Liferay Legend Mensajes: 1191 Fecha de incorporación: 10/03/10 Mensajes recientes
PortalUtil.getPortletNamespace(portletId)


But i wouldnt do that.

Instead use clientside ipc. broadcast an event from portlet1 and listen for the event in portlet2, then trigger the action.

That way you achieve loose coupling

This link might help http://www.liferay.com/community/wiki/-/wiki/Main/Client-side+Inter-Portlet+Communication
thumbnail
Raymond Gardner, modificado hace 12 años.

RE: How to get the namespace of another portlet?

Regular Member Mensajes: 118 Fecha de incorporación: 15/07/11 Mensajes recientes
Awesome! This is what I was wanted.

Thanks for the link as that will also be helpful.