Fórumok
Passing Parameters to portlet:RenderURL using aui:script not working
Dushyant Tusharkant Dave, módosítva 9 év-val korábban
Passing Parameters to portlet:RenderURL using aui:script not working
Junior Member Bejegyzések: 43 Csatlakozás dátuma: 2014.11.13. Legújabb bejegyzések
I am using Liferay 6.2 CE.
My requirement is to generate a POP_UP by onClick event of <a> link. In the POP_UP, I'm appending a next jsp file. Here, in the current jsp, I have a parameter to be passed on the next jsp(POP_UP). I have tried this aui:script,
<aui:script use="aui-io,aui-io-plugin-deprecated,liferay-util-window,aui-base">
Liferay.provide(
window,
'callPopUp',
function(param){
var A = AUI();
var renderURL = Liferay.PortletURL.createRenderURL();
renderURL.setPortletMode("view");
renderURL.setWindowState("pop_up");
renderURL.setParameter("page","/jsp-path"); //here we have tried "page", "jspPage" & "mvcPath"
renderURL.setParameter("param",param);
var callPopUp= Liferay.Util.Window.getWindow(
{
dialog: {
centered: true,
constrain2view: true,
modal: true,
resizable: false,
width: 475
}
}).plug(A.Plugin.DialogIframe,
{
autoLoad: true,
iframeCssClass: 'dialog-iframe',
uri: renderURL
}).render();
callPopUp.show();
callPopUp.titleNode.html("Pop Up title");
});
</aui:script>
but it's just generating next jsp file in POP_UP but I am not able to get the parameter I passed. Earlier in Liferay 6.1, I was using this aui:script,
<aui:script use="liferay-portlet-url,aui-io,aui-io-plugin-deprecated,liferay-util-window,aui-base">
Liferay.provide(
window,
'callPopUp',
function(param) {
var A = AUI();
var url = Liferay.PortletURL.createRenderURL();
url.setPortletMode("view");
url.setWindowState("pop_up");
url.setParameter("jspPage","/jsp-path");
url.setParameter("param",param);
var dialog = new A.Dialog({
modal: true,
title: 'Pop Up title',
height:600,
width:700,
resizable:true,
centered: true,
urlData: { windowState : 'LiferayWindowState.NORMAL'}
}).plug(A.Plugin.IO, {uri: url}).render();
dialog.show();
dialog.set('centered', true);
});
</aui:script>
it was working fine. I was able to get whichever parameter I parsed whether on jsp or on controller. Liferay 6.2 doesn't support "A.Dialog" and it was supported by Liferay 6.1, so I'm using "Liferay.Util.Window.getWindow". I'm not able to find the solution how to get the parameter to jsp file or to the controller by using aui:script in Liferay 6.2. Need Help on this?
My requirement is to generate a POP_UP by onClick event of <a> link. In the POP_UP, I'm appending a next jsp file. Here, in the current jsp, I have a parameter to be passed on the next jsp(POP_UP). I have tried this aui:script,
<aui:script use="aui-io,aui-io-plugin-deprecated,liferay-util-window,aui-base">
Liferay.provide(
window,
'callPopUp',
function(param){
var A = AUI();
var renderURL = Liferay.PortletURL.createRenderURL();
renderURL.setPortletMode("view");
renderURL.setWindowState("pop_up");
renderURL.setParameter("page","/jsp-path"); //here we have tried "page", "jspPage" & "mvcPath"
renderURL.setParameter("param",param);
var callPopUp= Liferay.Util.Window.getWindow(
{
dialog: {
centered: true,
constrain2view: true,
modal: true,
resizable: false,
width: 475
}
}).plug(A.Plugin.DialogIframe,
{
autoLoad: true,
iframeCssClass: 'dialog-iframe',
uri: renderURL
}).render();
callPopUp.show();
callPopUp.titleNode.html("Pop Up title");
});
</aui:script>
but it's just generating next jsp file in POP_UP but I am not able to get the parameter I passed. Earlier in Liferay 6.1, I was using this aui:script,
<aui:script use="liferay-portlet-url,aui-io,aui-io-plugin-deprecated,liferay-util-window,aui-base">
Liferay.provide(
window,
'callPopUp',
function(param) {
var A = AUI();
var url = Liferay.PortletURL.createRenderURL();
url.setPortletMode("view");
url.setWindowState("pop_up");
url.setParameter("jspPage","/jsp-path");
url.setParameter("param",param);
var dialog = new A.Dialog({
modal: true,
title: 'Pop Up title',
height:600,
width:700,
resizable:true,
centered: true,
urlData: { windowState : 'LiferayWindowState.NORMAL'}
}).plug(A.Plugin.IO, {uri: url}).render();
dialog.show();
dialog.set('centered', true);
});
</aui:script>
it was working fine. I was able to get whichever parameter I parsed whether on jsp or on controller. Liferay 6.2 doesn't support "A.Dialog" and it was supported by Liferay 6.1, so I'm using "Liferay.Util.Window.getWindow". I'm not able to find the solution how to get the parameter to jsp file or to the controller by using aui:script in Liferay 6.2. Need Help on this?
Kyle Joseph Stiemann, módosítva 9 év-val korábban
Moved.
Liferay Master Bejegyzések: 760 Csatlakozás dátuma: 2013.01.14. Legújabb bejegyzések
Kyle Joseph Stiemann, módosítva 9 év-val korábban
RE: Passing Parameters to portlet:RenderURL using aui:script not working
Liferay Master Bejegyzések: 760 Csatlakozás dátuma: 2013.01.14. Legújabb bejegyzések
Hi Dushyant,
Have you tried using AlloyUI's Modal component in place of AlloyUI Dialog? Note that the attributes may differ between these components but their functionality is very similar.
- Kyle
Have you tried using AlloyUI's Modal component in place of AlloyUI Dialog? Note that the attributes may differ between these components but their functionality is very similar.
- Kyle
Dushyant Tusharkant Dave, módosítva 9 év-val korábban
RE: Passing Parameters to portlet:RenderURL using aui:script not working
Junior Member Bejegyzések: 43 Csatlakozás dátuma: 2014.11.13. Legújabb bejegyzések
Hi Kyle,
Thanks for this earliest revert.
I have gone through your suggested link and the documentation for YUI (http://yuilibrary.com/yui/docs/panel/), but I am unable to find how to pass the URI using YUI.
If you have any real time solution how to set URI for renderURL in YUI, kindly revert back.
Thanks
Thanks for this earliest revert.
I have gone through your suggested link and the documentation for YUI (http://yuilibrary.com/yui/docs/panel/), but I am unable to find how to pass the URI using YUI.
If you have any real time solution how to set URI for renderURL in YUI, kindly revert back.
Thanks
Dushyant Tusharkant Dave, módosítva 9 év-val korábban
RE: Passing Parameters to portlet:RenderURL using aui:script not working
Junior Member Bejegyzések: 43 Csatlakozás dátuma: 2014.11.13. Legújabb bejegyzések
Hey, is there anyone who can help me on this?
I have been stuck on this for so long.
Is there any suggestion/real-time solution for my question?
I'm eagerly waiting for a reply.
I have been stuck on this for so long.
Is there any suggestion/real-time solution for my question?
I'm eagerly waiting for a reply.
Andew Jardine, módosítva 9 év-val korábban
RE: Passing Parameters to portlet:RenderURL using aui:script not working
Liferay Legend Bejegyzések: 2416 Csatlakozás dátuma: 2010.12.22. Legújabb bejegyzések
Hi Dushyant,
Can you trap the renderURL.toString() result and share it with us? Normally when I use the Liferay.PortletURL I have found that I need to include the plid and ppid in order for Liferay to know which portlet on which page to send the request to.
Can you trap the renderURL.toString() result and share it with us? Normally when I use the Liferay.PortletURL I have found that I need to include the plid and ppid in order for Liferay to know which portlet on which page to send the request to.
Tanweer Ahmed ., módosítva 1 év-val korábban
RE: Passing Parameters to portlet:RenderURL using aui:script not working
Expert Bejegyzések: 322 Csatlakozás dátuma: 2010.03.11. Legújabb bejegyzések
Hi Dushyant,
I have achieved the same requirement with the below code.Hope it helps you.
-Tanweer
I have achieved the same requirement with the below code.Hope it helps you.
<aui:script>
<portlet:renderurl var="importPagesURL" windowstate="<%= LiferayWindowState.POP_UP.toString() %>">
<portlet:param name="jspPage" value="/popup.jsp" />
</portlet:renderurl>
Liferay.provide(window, 'callPopUp', function(name) {
var A = AUI();
var dialog = Liferay.Util.Window.getWindow({
dialog : {
destroyOnHide : true,
cssClass: 'lfr-add-dialog',
width: 475
},
title : 'Pop Up title',
uri: '<%= importPagesURL.toString() %>',
});
var data = Liferay.Util.ns(
'<portlet:namespace />',{
userName: name
}
);
dialog.plug(
A.Plugin.IO,
{
data: data,
uri: '<%= importPagesURL.toString() %>'
}
);
}, ['aui-io-plugin-deprecated', 'aui-io', 'liferay-util-window']);
</aui:script>
In popup.jsp :
<%
String userName = ParamUtil.getString(request, "userName");
%>
-Tanweer