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 close Liferay.Util.openModal dialog
hi
i use Liferay.Util.openModal to popup a window
<aui:script position="inline" use="aui-base">
window.showEditSnmPrefixDialog2 = function(id) {
Liferay.Util.openModal(
{
title: '<%=descriptionPrefixInfoEdit%>',
centered: true,
modal: true,
height: 650,
url: '<%=modifyPrefixURL.toString()%>&<portlet:namespace />targetPart='+id,
size: 'md',
id: '<portlet:namespace/>dialog'
}
);
}
</aui:script>
<aui:script>
Liferay.provide(
window,
'<portlet:namespace/>closePopup',
function(data, dialogId) {
var A = AUI();
var dialog = Liferay.Util.Window.getById(dialogId);
dialog.destroy();
},
['liferay-util-window']
);
</aui:script>
and in my popup jsp
<aui:script use="aui-base">
A.one('#<portlet:namespace/>closeDialog').on('click', function(event) {
Liferay.Util.getOpener().<portlet:namespace/>closePopup(data, '<portlet:namespace/>dialog');
});
</aui:script>
<aui:button name="closeDialog" type="submit" value="<%=descriptionButtonEdit%>" />
the submit work, but dialog not close.
how to make it close doesnt metter the submit success or not?
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™