You need to sign in to do that
Don't have an account?

How to create a popup window based on onclick event.
Hi all,
I have created two pages, by name 'A' and 'B'.
What I require is, if I click 'Click here for B' link from the page 'A' the popup window should appear and display the page 'B' after filling the details in page 'B' when i click 'Ok' button of the page 'B', the page 'B' should disappear and the page 'A' should be continued.
Any help regarding this will be highly appreciated.
Note that I want to do this with out using java script.
Thanks in Advance.
To do onClick event have to use JS
function for open page B as popup window
function for close window(add page B's OK button)
onClick="window.close()"
-Suresh
All Answers
To do onClick event have to use JS
function for open page B as popup window
function for close window(add page B's OK button)
onClick="window.close()"
-Suresh
Use
<apex:outputLink value="#" onclick="window.open('URL FOR Visualforce page','mainWin',width=500,height=710');">Click here for B</apex:outputLink>
And for closing window in page B,
<apex:commandButton value="Ok" onclick = "window.close();"/>
Tryout the sample code given below :
<script>
function popup(oid)
{
var url='/apex/ma4?id=' + oid;
window.open(url,"Homepage","resizable=yes,status=yes,scrollbars=yes,width=400,height=200,target=_blank");
}
</script>
<apex:column ><apex:commandlink/>
<apex:facet>Browse</apex:facet>
</apex:column>
in Another visual force page(ma4)
<script>
function closeWindow()
{
if({!propSuccess})
{
window.parent.parent.opener.document.getElementById('xyz').onclick();
window.parent.close();
}
}
window.onload = closeWindow;
</script>
Hope this helps.