掲示板
Popup in Liferay 6
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?
13年前 に jelmer kuperus によって更新されました。
RE: Popup in Liferay 6
Liferay Legend 投稿: 1191 参加年月日: 10/03/10 最新の投稿
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');
13年前 に Brahim TARNAOUI によって更新されました。
RE: Popup in Liferay 6
Junior Member 投稿: 64 参加年月日: 10/06/15 最新の投稿
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
13年前 に ankit yakkundi によって更新されました。
RE: Popup in Liferay 6
Regular Member 投稿: 221 参加年月日: 10/03/05 最新の投稿
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..
13年前 に ankit yakkundi によって更新されました。
RE: Popup in Liferay 6
Regular Member 投稿: 221 参加年月日: 10/03/05 最新の投稿
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.
12年前 に Yan Naing Oo によって更新されました。
RE: Popup in Liferay 6
Regular Member 投稿: 179 参加年月日: 11/02/17 最新の投稿jelmer 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
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.
12年前 に jelmer kuperus によって更新されました。
RE: Popup in Liferay 6
Liferay Legend 投稿: 1191 参加年月日: 10/03/10 最新の投稿
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
12年前 に Enrique Ruiz (DiSiD) によって更新されました。
RE: Popup in Liferay 6
New Member 投稿: 1 参加年月日: 07/09/11 最新の投稿
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
12年前 に Danial Mustofa Habibi によって更新されました。
RE: Popup in Liferay 6
Regular Member 投稿: 141 参加年月日: 11/11/01 最新の投稿
Hi there how To pass paramater between page ???in pop Up???
Enrique 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.