how to close Liferay.Util.openModal dialog

Scarletake Bwi, modified 3 Years ago. Expert Posts: 327 Join Date: 12/20/10 Recent Posts

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?