how to close Liferay.Util.openModal dialoghow to close Liferay.Util.openModal dialoghttps://liferay.dev/c/message_boards/find_thread?p_l_id=119785333&threadId=1214883512024-03-29T11:13:22Z2024-03-29T11:13:22Zhow to close Liferay.Util.openModal dialogScarletake Bwihttps://liferay.dev/c/message_boards/find_message?p_l_id=119785333&messageId=1214883502022-08-04T06:13:21Z2022-08-03T06:08:55Z<p>hi </p>
<p>i use Liferay.Util.openModal to popup a window</p>
<pre>
<code class="language-java"><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></code></pre>
<p>and in my popup jsp</p>
<pre>
<code class="language-java"><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%>" /></code></pre>
<p>the submit work, but dialog not close. </p>
<p>how to make it close doesnt metter the submit success or not?</p>Scarletake Bwi