Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140390

Method should wait until window.open close

$
0
0

Am developing application in JSF. I have created t:commandlink that calls JavaScript method in onclick event, I have an action in same t:commandlink. That will trigger once onclick event complete. Before I used IE browser So, I used window.openmodaldialog('sample.xhtml', '_blank'); to open popup in javascript like below,

<t:commandlink onclick="openPopup()" action="#{samplebean.savedata()}"></t:commandlink>

Javascript code:

function openPopup(){
  window.showmodaldialog('sample.xhtml', '_blank');
  return true;
}

In above code 'openPopup' method wait until showmodaldialog to close. Now am migrating application to Chrome browser. So, I used window.open since window.showmodaldialog is deprecated in Chrome. What am facing issue here is openPopup method not waiting until popup to close. It's getting executed and t:commandlink action block get called. How to make openPopup method to wait until popup close.


Viewing all articles
Browse latest Browse all 140390

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>