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