0

我正在显示一个带有一些选择的弹出窗口(子窗口)。一旦用户在子窗口中提交它们,我就会将这些值传递给父窗口并提交表单。这些值正在毫无问题地提交到后端。但是,提交表单时父窗口不会刷新。

function commonPopup(popup, width, height, e, top, left) {
    myWindow=window.open('about:blank', popup, 'directories=0,scrollbars=yes, resizable=yes, location=0, menubar=0, status=0, toolbar=0, width=' + width + ', height=' + height + ', top=' + top + ', left=' + left);   
    myWindow.document.write('<HEAD>'); 
    myWindow.document.write('   <TITLE>Waiting for results</TITLE>'); 
    myWindow.document.write('</HEAD>');

}
function post_lock_unlock_value(reason,comment) {
    document.getElementById('lockReason').value = reason;
    document.getElementById('lockComment').value = comment;
    document.getElementById('triggerActionId').value='';
    document.getElementById('admRepairLock').submit();
}
<s:form name="lock" id="lock" action="my.action">
    <s:submit value="Lock Repair Profile" id="lockIndicator" name="lockIndicator"
                                                            onclick="commonPopup('lockProfile',450, 200, event,'lockRepairProfile');" cssStyle="width:200px" theme="simple"/>
</s:form>

在子页面中

function postback() {  
    window.opener.post_lock_unlock_value("data","data");
    self.close();

}
4

2 回答 2

0

尝试这个:

var newPartyId = $("#desc_textarea").val();
window.opener.$("#desc_textarea").val(newPartyId);
于 2013-06-29T00:31:06.380 回答
0

在关闭子窗口之前像这样刷新父级(在您的 之前添加这个self.close()):

if ( window.opener && !window.opener.closed ) {
   window.opener.location.reload();                     
   window.opener.focus();
}
于 2013-01-07T12:20:27.863 回答