Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
maq tom
put the contents of a portlet in a popup
July 21, 2011 3:06 AM
Answer

maq tom

Rank: New Member

Posts: 9

Join Date: June 1, 2011

Recent Posts

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:

 1
 2function showPopup() {
 3AUI().use('aui-dialog', 'aui-io', 'event-custom', 'io-form', function(A) {
 4    var instance = new A.Dialog({
 5        centered: true,
 6        constrain2view: true,
 7        destroyOnClose: true,
 8        draggable: true,
 9        height: 500,
10        resizable: false,
11        modal: true,
12        stack: true,
13        title: 'Authentification',
14        width: 1000
15        }).plug(A.Plugin.IO, {uri: '$sign_in_url'}).render();
16  });
17}


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



this is what happens:

Jelmer Kuperus
RE: put the contents of a portlet in a popup
July 21, 2011 4:54 AM
Answer

Jelmer Kuperus

Rank: Liferay Legend

Posts: 1192

Join Date: March 10, 2010

Recent Posts

Normally I guess you would use

1#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

1#set ($my_url = $portletURLFactory.create($request, "58", $getterUtil.getLong($plid), "RENDER_PHASE"))
2$my_url.setParameter("p_p_state", "exclusive")
maq tom
RE: put the contents of a portlet in a popup
July 22, 2011 1:49 AM
Answer

maq tom

Rank: New Member

Posts: 9

Join Date: June 1, 2011

Recent Posts

jelmer kuperus:
Normally I guess you would use

1#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

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



the seam thing , i have the footer and dockbar in popup of authentification emoticon
Jelmer Kuperus
RE: put the contents of a portlet in a popup
July 22, 2011 5:27 AM
Answer

Jelmer Kuperus

Rank: Liferay Legend

Posts: 1192

Join Date: March 10, 2010

Recent Posts

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
RE: put the contents of a portlet in a popup
July 22, 2011 7:27 AM
Answer

maq tom

Rank: New Member

Posts: 9

Join Date: June 1, 2011

Recent Posts

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 :


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


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


javascript :

 1
 2function showPopup() {
 3AUI().use('aui-dialog', 'aui-io', 'event-custom', 'io-form', function(A) {
 4    window.instance = new A.Dialog({
 5        centered: true,
 6        constrain2view: true,
 7        destroyOnClose: true,
 8        draggable: true,
 9        height: 500,
10        resizable: false,
11        modal: true,
12        stack: true,
13        title: 'Authentification',
14        width: 1000
15        }).plug(A.Plugin.IO, {uri: '$my_url'}).render(); 
16  });
17 
18}


so what do you think of that
maq tom
RE: put the contents of a portlet in a popup
July 22, 2011 7:38 AM
Answer

maq tom

Rank: New Member

Posts: 9

Join Date: June 1, 2011

Recent Posts

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!
David García González
RE: put the contents of a portlet in a popup
August 11, 2011 11:19 PM
Answer

David García González

Rank: Regular Member

Posts: 127

Join Date: July 14, 2009

Recent Posts

Take a look at this new entry blog, it could help you.

http://www.liferay.com/es/web/raymond.auge/blog/-/blogs/10429321
Armaz Mellati
RE: put the contents of a portlet in a popup
September 29, 2011 2:00 PM
Answer

Armaz Mellati

Rank: Junior Member

Posts: 94

Join Date: October 30, 2009

Recent Posts

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
Aritra Ghosh
RE: put the contents of a portlet in a popup
November 22, 2011 10:25 AM
Answer

Aritra Ghosh

Rank: Junior Member

Posts: 63

Join Date: November 8, 2011

Recent Posts

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??????
Attachment

Attachments: sign-in.png (70.4k)
OSTA Web CC
RE: put the contents of a portlet in a popup
June 19, 2012 6:22 AM
Answer

OSTA Web CC

Rank: New Member

Posts: 5

Join Date: February 4, 2010

Recent Posts

Hello Arithra, I have the same problem, did you find out a solution?