Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Priya Pratheep
get portletid
May 16, 2013 9:08 PM
Answer

Priya Pratheep

Rank: Junior Member

Posts: 38

Join Date: March 13, 2013

Recent Posts

Hi friends,

how to get portletid or portletname like mmmm_WAR_mmmm....

I tried String portletId = (String) req.getAttribute(WebKeys.PORTLET_ID); in public class ProjectReportPortlet extends GenericPortlet class but WebKeys can't recognized.I don't know what to include?

Even in ThemeDisplay themeDisplay= (ThemeDisplay)renderRequest.getAttribute(WebKeys.THEME_DISPLAY); too have WebKeys

Please help me to find our my portlet name.
Thanks in advance
Priya

Problem solved
http://www.liferay.com/community/forums/-/message_boards/message/12198734
Apoorva Prakash
RE: get portletid
May 16, 2013 9:29 PM
Answer

Apoorva Prakash

Rank: Liferay Master

Posts: 659

Join Date: June 15, 2010

Recent Posts

Priya Pratheep:
Hi friends,

how to get portletid or portletname like mmmm_WAR_mmmm....

I tried String portletId = (String) req.getAttribute(WebKeys.PORTLET_ID); in public class ProjectReportPortlet extends GenericPortlet class but WebKeys can't recognized.I don't know what to include?

Even in ThemeDisplay themeDisplay= (ThemeDisplay)renderRequest.getAttribute(WebKeys.THEME_DISPLAY); too have WebKeys

Please help me to find our my portlet name.
Thanks in advance
Priya


try the following:

1String pid = themeDisplay.getPortletDisplay().getId();

HTH

Thanks and Regards,
Apoorva Prakash
Jitendra Rajput
RE: get portletid
May 16, 2013 11:35 PM
Answer

Jitendra Rajput

Rank: Liferay Master

Posts: 858

Join Date: January 7, 2011

Recent Posts

You can also try with PortalUtil.getPortletId(request)