Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
how to pass parameter to popup openModal window
hi
i'd like to know how to send parameter to popup window with openModal.
<portlet:renderURL var="secondJspURL" windowState="<%=LiferayWindowState.POP_UP.toString()%>">
<portlet:param name="mvcPath" value="/second.jsp"/>
</portlet:renderURL>
<aui:script position="inline" use="aui-base">
window.showEditSnmPrefixDialog2 = function(id) {
alert(id);
Liferay.Util.openModal(
{
title: 'My Own Title(400x400 Window Size)',
url: '<%=secondJspURL.toString()%>',
size: 'md',
urlData :{
'#<portlet:namespace />targetPart' : id,
}
}
);
}
</aui:script>
doesn't work,
i also try
url: '<%=secondJspURL.toString()%>?targetPart='+id,
doesn't work too.
Hi,
You can try adding PortletNamespace to parameter name and check.
url: '<%=secondJspURL.toString()%>&<portlet:namespace />targetPart='+id,
Also you can use Liferay.Util.addParams(parameter,url);
url: Liferay.Util.addParams('<portlet:namespace />targetPart='+id,'<%=secondJspURL.toString()%>');
hi Mohammed
thank you very much. it works.
where can i find the document about openModal? for example, i'd like to know what is md of size mean, how to change the size to auto-fit the content..etc
again, thank you.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™