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 に答える