Dear forum members,
I have a form, which is opened as a popup window. After submitting the popup, it closes and should reopen the calling window (refresh).
My code looks like this:
<script language="JavaScript" type="text/javascript">
<script language="JavaScript">
function closeThisPopup(){
window.opener.redirect('f?p=&APP_ID.:320:&SESSION.::NO::P320_PK:&P325_PK.');
window.close();
}
function passBack2(){
doSubmit('SUBMIT');
setTimeout(closeThisPopup(),5000);
}
</script>
Okay so far. Two things aren't working the way I supposed them to do:
1. The setTimeout method does NOT wait 5000ms=5 seconds.
2. This javascript code does refresh the contents of the calling window in about 30% of all trials. I suppose, that the commit takes more time than recalling the opener window.
How can improve this?
Any suggestions/comments welcome!
Best regards,
Johann