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.