bir URL oluşturmak için aşağıdaki yöntemlerden birini kullanabilirsiniz <portlet:renderURL>
veya <liferay-portlet:renderURL>
<liferay-portlet:renderURL
var="testPopupURL"
portletName="testPopup_WAR_testPopupportlet"
windowState="<%=LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="paramToPopup" value="customParameterToThePortlet" />
</liferay-portlet:renderURL>
portletName="testPopup_WAR_testPopupportlet"
Bu, istediğiniz portletin portletidir açmak.
windowState="<%=LiferayWindowState.POP_UP.toString() %>"
Bu sadece pop-up portleti göstermek için önemlidir, aksi takdirde navigasyon ve tüm tam liferay sayfalarını açacak.
Yukarıdaki URL'yi kullanabilir ve pop-up ve içinde portleti açmak için JSP yazabilirsiniz javascript:
: Sadece böyle javascript fonksiyonları şey bu çağırabilir // this is one of creating function
function <portlet:namespace />showPopup(url) {
var url = url;
// this is one way of calling a pop-up in liferay
// this way is specific to liferay
Liferay.Util.openWindow(
{
dialog: {
cache: false,
width:800,
modal: true
},
id: 'testPopupIdUnique',
uri: url
}
);
}
// this is another way of creating a function in liferay
Liferay.provide(
window,
'<portlet:namespace />showAUIPopUP',
function(url) {
var A = AUI();
// this is another way of calling a iframe pop-up
// this way is not specific to liferay
popupDialog = new A.Dialog(
{
id: 'testPopupIdUnique',
centered: true,
draggable: true,
resizable: true,
width: 800,
stack: true
}
).plug(
A.Plugin.DialogIframe,
{
uri: url,
iframeCssClass: 'ogilvy-dialog-iframe'
}
);
popupDialog.render();
},
['aui-dialog','aui-dialog-iframe']
);
<a href="javascript: <portlet:namespace />showPopup('<%=testPopupURL%>')">
Popup using Liferay open-window
</a>
<a href="javascript: <portlet:namespace />showAUIPopUP('<%=testPopupURL%>')">
Pop-up using Alloy UI dialog
</a>
pop-up iframe
içinde görüntülenir olacaktır portleti ya liferay-portlet.xml
olarak <add-default-resource>true</add-default-resource>
sahip olmalıdır:
<portlet>
<portlet-name>testPopup</portlet-name>
<icon>/icon.png</icon>
<instanceable>false</instanceable>
<header-portlet-css>/css/main.css</header-portlet-css>
<footer-portlet-javascript>/js/main.js</footer-portlet-javascript>
<css-class-wrapper>testPopup-portlet</css-class-wrapper>
<!-- This property is necessary otherwise you would see a "Access denied for portlet" message when you try to open this portlet dynamically -->
<add-default-resource>true</add-default-resource>
</portlet>
Veya olarak portal-ext.properties
tesisle portlet.add.default.resource.check.whitelist
olmalıdır:
portlet.add.default.resource.check.whitelist=3,56_INSTANCE_0000,58,82,86,87,88,103,113,145,164,166,170,177,testPopup_WAR_testPopupportlet