Foros de discusión

open new Liferay porlet in a popup.

santhosh kumar, modificado hace 11 años.

open new Liferay porlet in a popup.

New Member Mensajes: 19 Fecha de incorporación: 11/04/11 Mensajes recientes
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, modificado hace 11 años.

RE: open new Liferay porlet in a popup.

New Member Mensajes: 19 Fecha de incorporación: 11/04/11 Mensajes recientes
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
thumbnail
Prakash Khanchandani, modificado hace 11 años.

RE: open new Liferay porlet in a popup.

Expert Mensajes: 329 Fecha de incorporación: 10/02/11 Mensajes recientes
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:

portlet.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.
thumbnail
Amruta Naidu, modificado hace 10 años.

RE: open new Liferay porlet in a popup.

New Member Mensajes: 12 Fecha de incorporación: 24/04/13 Mensajes recientes
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.....
thumbnail
Alireza Zare, modificado hace 10 años.

RE: open new Liferay porlet in a popup.

Regular Member Mensajes: 110 Fecha de incorporación: 3/09/10 Mensajes recientes
Hi,
Try the following link:
http://www.liferaysolution.com/2011/11/popup-in-liferay.html#.UXjfxLXIbsw
thumbnail
Amruta Naidu, modificado hace 10 años.

RE: open new Liferay porlet in a popup.

New Member Mensajes: 12 Fecha de incorporación: 24/04/13 Mensajes recientes
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, modificado hace 9 años.

RE: open new Liferay porlet in a popup.

New Member Mensajes: 5 Fecha de incorporación: 13/08/13 Mensajes recientes
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.