Fórumok
Popup in Liferay 6
Andreas S, módosítva 13 év-val korábban
Popup in Liferay 6
New Member Bejegyzések: 20 Csatlakozás dátuma: 2010.10.26. Legújabb bejegyzések
My popup code isn't working anymore in Liferay 6.
I searched a little and saw that jquery has been replaced by Alloy.
I checked Alloy and saw a dialog module which looked similar but when I took a look at the API I didn't see a way to use a url in the popup (just text in bodyContent).
Anyone have any ideas?
var popup = Liferay.Popup({title:"Login",modal:true,width:400,center:true});
jQuery(popup).load(url, {});
I searched a little and saw that jquery has been replaced by Alloy.
I checked Alloy and saw a dialog module which looked similar but when I took a look at the API I didn't see a way to use a url in the popup (just text in bodyContent).
Anyone have any ideas?
jelmer kuperus, módosítva 13 év-val korábban
RE: Popup in Liferay 6
Liferay Legend Bejegyzések: 1191 Csatlakozás dátuma: 2010.03.10. Legújabb bejegyzések
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) {
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: false,
width: 600,
xy: [15,15]
}
).plug(
A.Plugin.IO,
{autoLoad: false}
).render();
}
return instance._popup;
}
}
}
);
Liferay.YourPlugin.displayPopup('/your/url');
Brahim TARNAOUI, módosítva 13 év-val korábban
RE: Popup in Liferay 6
Junior Member Bejegyzések: 64 Csatlakozás dátuma: 2010.06.15. Legújabb bejegyzések
Hi,
just i copy/paste your code, but is not executed.
can you explain me howto execute your code, if i will add some library or other.
and how can'i put the data in the popup using urlData attribute?
thx
just i copy/paste your code, but is not executed.
can you explain me howto execute your code, if i will add some library or other.
and how can'i put the data in the popup using urlData attribute?
thx
ankit yakkundi, módosítva 13 év-val korábban
RE: Popup in Liferay 6
Regular Member Bejegyzések: 221 Csatlakozás dátuma: 2010.03.05. Legújabb bejegyzések
hi..
can you please explain the steps which i need to follow to get the pop up portlet ie which files i need to use or change.
i want to create simple pop up when will be opened when a button is clicked from the portlet.
Thanks in advance..
Any idea or suggestions are welcome..
can you please explain the steps which i need to follow to get the pop up portlet ie which files i need to use or change.
i want to create simple pop up when will be opened when a button is clicked from the portlet.
Thanks in advance..
Any idea or suggestions are welcome..
ankit yakkundi, módosítva 13 év-val korábban
RE: Popup in Liferay 6
Regular Member Bejegyzések: 221 Csatlakozás dátuma: 2010.03.05. Legújabb bejegyzések
hi.
I am able to open the popup,but i wanted to know how can i give the url of the another portlet.for example if i have portlet called a-portlet and b-portlet in webapps.i want to open b-portlet as popup to a-portlet then i have url as "/b-portlet/view.jsp..
the popup shows "Failed to retrieve content".
Can you help me on this.
Any help or idea are welcome.
Thanks in advance.
I am able to open the popup,but i wanted to know how can i give the url of the another portlet.for example if i have portlet called a-portlet and b-portlet in webapps.i want to open b-portlet as popup to a-portlet then i have url as "/b-portlet/view.jsp..
the popup shows "Failed to retrieve content".
Can you help me on this.
Any help or idea are welcome.
Thanks in advance.
Yan Naing Oo, módosítva 12 év-val korábban
RE: Popup in Liferay 6
Regular Member Bejegyzések: 179 Csatlakozás dátuma: 2011.02.17. Legújabb bejegyzésekjelmer kuperus:
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) { 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: false, width: 600, xy: [15,15] } ).plug( A.Plugin.IO, {autoLoad: false} ).render(); } return instance._popup; } } } );
Liferay.YourPlugin.displayPopup('/your/url');
Hi jelmer ,
If i want to to display when the home page is come out the popup will display. how can i do this ? could you please describe me by step ?
thanks
delang j, módosítva 12 év-val korábban
RE: Popup in Liferay 6
Expert Bejegyzések: 252 Csatlakozás dátuma: 2008.07.14. Legújabb bejegyzések
hi,
thanks for the code, right now it working fine in my custom portlet.
but new issue arise, how do i set position of pop up from top?
i did tried
and
but failed.
am i missing something.
below is my code
thanks.
thanks for the code, right now it working fine in my custom portlet.
but new issue arise, how do i set position of pop up from top?
i did tried
centered: true,
and
xy: ['center',10]
but failed.
am i missing something.
below is my code
<portlet:renderurl var="suggestNewPlaceURL" windowstate="<%= LiferayWindowState.EXCLUSIVE.toString() %>">
<portlet:param name="jspPage" value="/suggest.jsp" />
</portlet:renderurl>
<%
String newPopup = "Liferay.test.displayPopup('" + suggestNewPlaceURL.toString() + "');";
%>
<aui:button-row>
<aui:button onClick="<%= newPopup %>" value="suggest-new-place" />
</aui:button-row>
<script type="text/javascript">
AUI().use('aui-dialog', function(A) {
Liferay.test = {
closePopup: function() {
var instance = this;
var popup = instance._getPopup();
if (popup) {
popup.hide();
}
},
displayPopup: function(url) {
var instance = this;
var popup = instance._getPopup();
popup.show();
popup.io.set('uri', url);
popup.io.start();
},
_getPopup: function() {
var instance = this;
if (!instance._popup) {
instance._popup = new A.Dialog(
{
title: "suggest-new-place",
resizable: false,
centered: true,
destroyOnClose: true,
width: 600,
xy: ['center',10]
}
).plug(
A.Plugin.IO,
{autoLoad: false}
).render();
}
return instance._popup;
}
}
});
</script>
thanks.
jelmer kuperus, módosítva 12 év-val korábban
RE: Popup in Liferay 6
Liferay Legend Bejegyzések: 1191 Csatlakozás dátuma: 2010.03.10. Legújabb bejegyzések
In my example code you see these lines :
if you change xy: [15,15] to centered: true it will center the dialog to the middle of the screen
if you change xy: [15,15] to align: { node: null, points: [A.WidgetPositionAlign.TC, A.WidgetPositionAlign.TC] } it will align the dialog to the top center of the screen
instance._popup = new A.Dialog(
{
resizable: false,
width: 600,
xy: [15,15]
}
if you change xy: [15,15] to centered: true it will center the dialog to the middle of the screen
if you change xy: [15,15] to align: { node: null, points: [A.WidgetPositionAlign.TC, A.WidgetPositionAlign.TC] } it will align the dialog to the top center of the screen
Enrique Ruiz (DiSiD), módosítva 12 év-val korábban
RE: Popup in Liferay 6
New Member Bejegyzés: 1 Csatlakozás dátuma: 2007.09.11. Legújabb bejegyzések
Hi all,
There is a little bug in jelmer's code, missing ;
Below the fix:
Regards
There is a little bug in jelmer's code, missing ;
Below the fix:
closePopup: function() {
var instance = this;
var popup = instance._getPopup();
Regards
Danial Mustofa Habibi, módosítva 12 év-val korábban
RE: Popup in Liferay 6
Regular Member Bejegyzések: 141 Csatlakozás dátuma: 2011.11.01. Legújabb bejegyzések
Hi there how To pass paramater between page ???in pop Up???
me liferay, módosítva 11 év-val korábban
RE: Popup in Liferay 6
Junior Member Bejegyzések: 25 Csatlakozás dátuma: 2011.12.14. Legújabb bejegyzésekEnrique Ruiz (DiSiD):
Hi all,
There is a little bug in jelmer's code, missing ;
Below the fix:closePopup: function() { var instance = this; var popup = instance._getPopup();
Regards
I am facing one more problem popup gets appear only one time once I close pop up it does not appear again.
If I refresh the page and then click the button then only it appears second time.
Please let me know if you have any idea.
Jobin Mathew, módosítva 9 év-val korábban
RE: Popup in Liferay 6
Junior Member Bejegyzések: 77 Csatlakozás dátuma: 2014.07.04. Legújabb bejegyzések
hi
i tried the same but no popup appears. and error in mozillla bowser as follows.
"TypeError: a.Dialog is not a constructor"
please help
i tried the same but no popup appears. and error in mozillla bowser as follows.
"TypeError: a.Dialog is not a constructor"
please help