<apex:page showHeader="false"> <apex:form > <script> var newWin=null;
function openPopup() {
var url="/apex/RelatedChildContact"; // Change this with your Vf page newWin=window.open(url, 'Popup','height=500,width=600,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
Hi,
Try the below code sample :
<apex:page showHeader="false">
<apex:form >
<script>
var newWin=null;
function openPopup()
{
var url="/apex/RelatedChildContact"; // Change this with your Vf page
newWin=window.open(url, 'Popup','height=500,width=600,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
newWin.focus();
return false;
}
function closePopup()
{
if (newWin.parent != null)
{
newWin.close();
}
}
</script>
<apex:commandLink value="Open" onclick="openPopup();"/><br/>
<apex:commandLink value="Close" onclick="closePopup();"/>
</apex:form>
</apex:page>
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
How about <apex:commandlink target="_blank" ... />
target="_blank" will also open the url on new window.