Foros de discusión

RE: put the contents of a portlet in a popup

maq tom, modificado hace 12 años.

put the contents of a portlet in a popup

New Member Mensajes: 9 Fecha de incorporación: 1/06/11 Mensajes recientes
I want to put the authentication in a popup that is received within liferau, but he put the bar and the footer in popup, I want to put only the contents of the portlet, not the designer, I work with portal 6.0.6 : portal_normal.vm

here is my source code:

a function in java script portal_normal.vm:


function showPopup() {
AUI().use('aui-dialog', 'aui-io', 'event-custom', 'io-form', function(A) {
    var instance = new A.Dialog({
        centered: true,
        constrain2view: true,
        destroyOnClose: true,
        draggable: true,
        height: 500,
        resizable: false,
        modal: true,
        stack: true,
        title: 'Authentification',
        width: 1000
        }).plug(A.Plugin.IO, {uri: '$sign_in_url'}).render(); 
  });
}



<a href="javascript:void(0)" onclick="showPopup()"> Click Here </a> 



this is what happens:

thumbnail
jelmer kuperus, modificado hace 12 años.

RE: put the contents of a portlet in a popup

Liferay Legend Mensajes: 1191 Fecha de incorporación: 10/03/10 Mensajes recientes
Normally I guess you would use

#set ($my_url = $theme.renderURL('exclusive', 'view', '58', ''))


But this seems broken in at least liferay 6.0.6. So as an alternative you could use

#set ($my_url = $portletURLFactory.create($request, "58", $getterUtil.getLong($plid), "RENDER_PHASE"))
$my_url.setParameter("p_p_state", "exclusive")
maq tom, modificado hace 12 años.

RE: put the contents of a portlet in a popup

New Member Mensajes: 9 Fecha de incorporación: 1/06/11 Mensajes recientes
jelmer kuperus:
Normally I guess you would use

#set ($my_url = $theme.renderURL('exclusive', 'view', '58', ''))


But this seems broken in at least liferay 6.0.6. So as an alternative you could use

#set ($my_url = $portletURLFactory.create($request, "58", $getterUtil.getLong($plid), "RENDER_PHASE"))
$my_url.setParameter("p_p_state", "exclusive")



the seam thing , i have the footer and dockbar in popup of authentification emoticon
thumbnail
jelmer kuperus, modificado hace 12 años.

RE: put the contents of a portlet in a popup

Liferay Legend Mensajes: 1191 Fecha de incorporación: 10/03/10 Mensajes recientes
I am pretty sure it should work. The key is setting the window state to exclusive. Are you sure you are doing it correctly ?
maq tom, modificado hace 12 años.

RE: put the contents of a portlet in a popup

New Member Mensajes: 9 Fecha de incorporación: 1/06/11 Mensajes recientes
jelmer kuperus:
I am pretty sure it should work. The key is setting the window state to exclusive. Are you sure you are doing it correctly ?


sure , here's what I did :

in file portal_normal.vm i put this :



#set ($my_url = $portletURLFactory.create($request, "58", $getterUtil.getLong($plid), "RENDER_PHASE"))
$my_url.setParameter("p_p_state", "exclusive")



<a href="#" id="sign-in" rel="nofollow" onclick="showPopup()">$sign_in_text</a>


javascript :


function showPopup() {
AUI().use('aui-dialog', 'aui-io', 'event-custom', 'io-form', function(A) {
    window.instance = new A.Dialog({
		centered: true,
		constrain2view: true,
		destroyOnClose: true,
		draggable: true,
		height: 500,
		resizable: false,
		modal: true,
		stack: true,
		title: 'Authentification',
		width: 1000
		}).plug(A.Plugin.IO, {uri: '$my_url'}).render();  
  });
  
}


so what do you think of that
maq tom, modificado hace 12 años.

RE: put the contents of a portlet in a popup

New Member Mensajes: 9 Fecha de incorporación: 1/06/11 Mensajes recientes
We must recover the direct URL of the portlet.
A portlet:
- Click on the wrench (configuration).
- Go to the menu "share" (= "sharing").
- In the HTML code provided here, grab the URL pointed.

This URL will point directly to the portlet, and there will be no longer the header and footer of the page.

Limit: a portal to another, the URL may change. There is no full stability before moving into production.
If anyone knows a better solution to this, let me know!
thumbnail
Aritra Ghosh, modificado hace 12 años.

RE: put the contents of a portlet in a popup

Junior Member Mensajes: 62 Fecha de incorporación: 8/11/11 Mensajes recientes
Hi Jelmer,
Thanks for your suggestion.It's working properly.I can get the pop-up for sign-in portlet.But,the normal validation is not working.If I click on submit button leaving the input fields blank,it takes me to a blank page.
Any suggestion??????

Archivos adjuntos:

thumbnail
ODIA Web CC, modificado hace 11 años.

RE: put the contents of a portlet in a popup

New Member Mensajes: 5 Fecha de incorporación: 4/02/10 Mensajes recientes
Hello Arithra, I have the same problem, did you find out a solution?
thumbnail
David García González, modificado hace 12 años.

RE: put the contents of a portlet in a popup

Regular Member Mensajes: 127 Fecha de incorporación: 14/07/09 Mensajes recientes
Take a look at this new entry blog, it could help you.

http://www.liferay.com/es/web/raymond.auge/blog/-/blogs/10429321
thumbnail
Armaz Mellati, modificado hace 12 años.

RE: put the contents of a portlet in a popup

Junior Member Mensajes: 96 Fecha de incorporación: 30/10/09 Mensajes recientes
Hi

I have a similar need in my project, and this approach seems to work fine with some portlets like the search portlet (id 3).
However with some other portlets, for instance "My communities" (portlet id : 29) I get this : "This portlet is inactive. "
But it works if the portlet is already added to the page, then it pops up nicely !! But then it is worthless.

I have already added the id 29 to the whitelist in case thats why this happens. (portlet.add.default.resource.check.whitelist).

Any help is appreciated to find out why this only works with some portlets.

Regards
Armaz Mellati