留言板
How to close popup after submit form
Hi,
I have a popup with a form on it in, but when i submit the form, it doesnt close the popup.
When i try to put a function to close after submit the form, it doesnt submit but close it..
What can i do?
Here is how i open the popup and make the submit:
<portlet:actionURL var="renderPopUpRejURL" windowState="<%=LiferayWindowState.POP_UP.toString()%>">
<portlet:param name="action" value="renderPopUpRejURL"/>
</portlet:actionURL>
function showMotivoRej(value) {
Liferay.Util.openWindow(
{
title: 'Motivos da Rejeição',
dialog: {
position:['center',150],
modal:true,
width:550,
height:330,
xy: ['center', 'center']
},
id: 'motivoRejPopup',
uri: '<%= renderPopUpRejURL.toString()+"&posicao=" %>'+value
});
Liferay.provide(
window,
'closePopup',
function(popupIdToClose) {
var dialog = Liferay.Util.getWindow(popupIdToClose);
dialog.destroy(); // You can try toggle/hide whatever You want
},
['aui-base','aui-dialog','aui-dialog-iframe']
);
}
<-- submit part -->
jQuery('#motrej').attr('action', '<%= renderPopUpRejURL+"&opcao=1&posicao="%>'+pos);
jQuery("#motrej").submit();
Thanks and sorry for my english
I have a popup with a form on it in, but when i submit the form, it doesnt close the popup.
When i try to put a function to close after submit the form, it doesnt submit but close it..
What can i do?
Here is how i open the popup and make the submit:
<portlet:actionURL var="renderPopUpRejURL" windowState="<%=LiferayWindowState.POP_UP.toString()%>">
<portlet:param name="action" value="renderPopUpRejURL"/>
</portlet:actionURL>
function showMotivoRej(value) {
Liferay.Util.openWindow(
{
title: 'Motivos da Rejeição',
dialog: {
position:['center',150],
modal:true,
width:550,
height:330,
xy: ['center', 'center']
},
id: 'motivoRejPopup',
uri: '<%= renderPopUpRejURL.toString()+"&posicao=" %>'+value
});
Liferay.provide(
window,
'closePopup',
function(popupIdToClose) {
var dialog = Liferay.Util.getWindow(popupIdToClose);
dialog.destroy(); // You can try toggle/hide whatever You want
},
['aui-base','aui-dialog','aui-dialog-iframe']
);
}
<-- submit part -->
jQuery('#motrej').attr('action', '<%= renderPopUpRejURL+"&opcao=1&posicao="%>'+pos);
jQuery("#motrej").submit();
Thanks and sorry for my english
Solved:
var url = '<%=renderPopUpRejURL+"&opcao=1&posicao="%>'+pos;
$.ajax({url:url,type: 'POST', data: jQuery('#motrej').serialize(), success:function(result){
$("#_ativarutilizador_WAR_CV_MTIEportlet_voltar").click();
}});
If submited with sucess, click on button to close the popup.
var url = '<%=renderPopUpRejURL+"&opcao=1&posicao="%>'+pos;
$.ajax({url:url,type: 'POST', data: jQuery('#motrej').serialize(), success:function(result){
$("#_ativarutilizador_WAR_CV_MTIEportlet_voltar").click();
}});
If submited with sucess, click on button to close the popup.
krishna mohan mathakala,修改在9 年前。
RE: How to close popup after submit form
Junior Member 帖子: 68 加入日期: 12-9-8 最近的帖子
Hi use the following line of code to close the pop up
A.DialogManager.hideAll();
A.DialogManager.hideAll();