Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
santhosh kumar
open new Liferay porlet in a popup.
January 3, 2013 3:06 AM
Answer

santhosh kumar

Rank: New Member

Posts: 19

Join Date: April 10, 2011

Recent Posts

Hi,
I have requirement in which i need to open a new porlet in a popup window.And is it possible to add a portlet in a popup window without adding it on any page.
i use liferay 6.0.5 version.


Regards
Santhosh
santhosh kumar
RE: open new Liferay porlet in a popup.
January 3, 2013 3:11 AM
Answer

santhosh kumar

Rank: New Member

Posts: 19

Join Date: April 10, 2011

Recent Posts

Hi Prakash,

With help of Below code i'm able to get a popup but not the particular portlat.
Please guide me

function parentPage() {
Liferay.YourPlugin.displayPopup("http://localhost:8089/web/guest/home?p_p_id=adddocumentportlet_WAR_adddocumentportlet&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view","HI");
}

AUI().use('aui-dialog', function(A) {
Liferay.YourPlugin = {
closePopup: function() {
var instance = this;
var popup = instance._getPopup();
if (popup) {
popup.hide();
}
},
displayPopup: function(url, title) {
alert("hi display");
var instance = this;
var popup = instance._getPopup();
popup.show();
popup.set('title', title);
popup.io.set('uri', url);
popup.io.start();
},
_getPopup: function() {
var instance = this;
if (!instance._popup) {
instance._popup = new A.Dialog(
{
resizable: true,
width: 600,
xy: [150,150]
}
).plug(
A.Plugin.IO,
{
autoLoad: false
}
).render();
} return instance._popup;
}
}
});


Regards
Santhosh
Prakash Khanchandani
RE: open new Liferay porlet in a popup.
January 11, 2013 5:10 AM
Answer

Prakash Khanchandani

Rank: Expert

Posts: 291

Join Date: February 10, 2011

Recent Posts

It might be quite late, but here it is anyway if you have not yet figured it out.

I have attached a zip file which contain source code for the following two portlets:
1) ShowPopup
2) testPopup

You can just include the folders inside the zip in your plugin-portlet, build and deploy.

The showPopup portlet contains the script which displays the testPopUp portlet inside a dialog-iframe. I have included two ways in which the opening of a pop-up is possible. Please go through view.jsp of this portlet and you would understand the script.

The testPopup portlet need not be put on any page, this just needs to be deployed. Please go through the view.jsp and also the liferay-portlet.xml for this portlet, I have included some comments for explanation.

The contents of the portlets are self-explanatory.

Here are the steps to test:
1) Put in the plugins-sdk the two folders
2) Deploy the two portlets
3) Add the showPopup portlet on any page
4) Click on the links as mentioned in the view page itself
5) Hurray! you see the test-portlet

Also if you want to show any liferay portlet inside the pop-up than you need to include the portlet-id in the following property in your portal-ext.properties file:

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


Hope this helps.
Attachments: 2-sample-portlets.zip (42.3k)
Amruta Naidu
RE: open new Liferay porlet in a popup.
April 25, 2013 12:08 AM
Answer

Amruta Naidu

Rank: New Member

Posts: 12

Join Date: April 23, 2013

Recent Posts

The above mentioned code and two portlets are not compatible with liferay CE 6.1.0 ??????

I have a requirement similar to this......
I need to open a web form portlet on click.
and the button is present in theme, on click of which the web form should open...


Please rply if anyone has any idea...... m in big trouble........ emoticon

Thanks.....
Alireza Zare
RE: open new Liferay porlet in a popup.
April 25, 2013 12:51 AM
Answer

Alireza Zare

Rank: Regular Member

Posts: 110

Join Date: September 3, 2010

Recent Posts

Hi,
Try the following link:
http://www.liferaysolution.com/2011/11/popup-in-liferay.html#.UXjfxLXIbsw
Amruta Naidu
RE: open new Liferay porlet in a popup.
April 25, 2013 2:07 AM
Answer

Amruta Naidu

Rank: New Member

Posts: 12

Join Date: April 23, 2013

Recent Posts

Hi Alireza.....

thanks for replying...... but where should i keep the code? in web form portlet view.jsp?
and how to give the portlet id here in this case?

thanks.....
Ashok Siddaiah
RE: open new Liferay porlet in a popup.
June 28, 2014 11:39 AM
Answer

Ashok Siddaiah

Rank: New Member

Posts: 5

Join Date: August 13, 2013

Recent Posts

Hi, i have a similar requirement on Liferay version 6.1.2-ce-ga2. I need to open a web form portlet (such as feedback form) on click of button on the home page (in navigation menu), how to do it? Please help.