Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hardik Rajani
Issue with portlet in popup
June 19, 2014 9:55 AM
Answer

Hardik Rajani

Rank: New Member

Posts: 5

Join Date: June 19, 2014

Recent Posts

I am facing issue with opening a custom portlet in popup window.

Below is the code of opening popup.

<%
LiferayPortletURL documentLibURL = PortletURLFactoryUtil.create(request, "portlet name with WAR name", themeDisplay.getPlid(), PortletRequest.RENDER_PHASE);
documentLibURL.setWindowState(LiferayWindowState.POP_UP);
documentLibURL.setPortletMode(PortletMode.VIEW);
%>

AUI().use('aui-dialog', 'aui-io', 'event', 'event-custom', function(A) {
var dialog = new A.Dialog({
width: 800,
height: 500,
title: 'Popup Title',
centered: true,
draggable: true,
modal: true
}).plug(A.Plugin.IO, {uri: '<%= documentLibURL.toString() %>'}).render();

dialog.show();

});

When my portlet is not having any call to local services, portlet is being rendered in popup. But after adding some complex code. Portlet is giving permission error.
"You do not have the roles required to access this portlet."

1) I have also added <add-default-resource>true</add-default-resource> in liferay-portlet.xml.
2) I have assigned permissions to guest user for view from control panel.


Please let me know if any changes requires.

Thanks in advance
Meera Prince
RE: Issue with portlet in popup
June 19, 2014 7:43 PM
Answer

Meera Prince

Rank: Liferay Legend

Posts: 1110

Join Date: February 8, 2011

Recent Posts

Hi
Have a look into following link it may help you..

Add following in liferay-portlet.xml file

<add-default-resource>true</add-default-resource>
<system>true</system>

Add portlet id in portal-ext.properties file with following property list

portlet.add.default.resource.check.whitelist=3,56_INSTANCE_0000,
58,82,86,87,88,103,113,145,164,166,170,177,
PortletY_WAR_OpenPortletAuiDialgportlet


if the portlet functionality have any action and render task then open in iframe dialog ...
if you use all resourceURL or ajax calls then you can use normal dialog..


http://www.liferaysavvy.com/2014/06/liferay-62-aui-dialog-liferay-popup.html

Regards,
Meera Prince
Hardik Rajani
RE: Issue with portlet in popup
June 22, 2014 12:12 AM
Answer

Hardik Rajani

Rank: New Member

Posts: 5

Join Date: June 19, 2014

Recent Posts

I was working on that till now. I get to know that. If I am not adding my portlet on any page, this error is coming. Once I add my portlet to some page. Portlet is also being rendered in the popup. It is something like Liferay is not getting any instance of portlet.

Let me know if there is any solution to that.
Meera Prince
RE: Issue with portlet in popup
June 22, 2014 6:47 PM
Answer

Meera Prince

Rank: Liferay Legend

Posts: 1110

Join Date: February 8, 2011

Recent Posts

Hi
Add following tags in liferay-portlet.xml

and in the article you might have read reference links so that you could understand more..

<add-default-resource>true</add-default-resource>
<system>true</system>

And follwoing property aslo realted to above reason..

Add portlet id in portal-ext.properties file with following property list


portlet.add.default.resource.check.whitelist=3,56_INSTANCE_0000,
58,82,86,87,88,103,113,145,164,166,170,177,
PortletY_WAR_OpenPortletAuiDialgportlet

Read following article

http://www.liferaysavvy.com/2013/12/open-liferay-portlet-in-aui-dialogpopup.html



Regards,
Meera Prince