Pages

Monday, August 31, 2009

Get Current Portlet ID

Way 1- liferay Theme objects will give us the current portlet Id. (To know about liferay theme
objects please go through my previous post)

portletDisplay.getId();


Way 2- we can directly get the current portlet id using webkeys. To get WebKeys reference we
need to import

com.liferay.portal.kernel.util.WebKeys which is available in portal-kernal.jar file.

request.getAttribute(WebKeys.PORTLET_ID)

No comments:

Post a Comment