Visualforce Popup Window - pass parameters
4:47 AMHere is a small example of how to pass values from your popup window to your parent window...........
This example uses javascript....
Parent Page: (popupparent)
Name this visualforce page as "popupparent"
<apex:page showheader="false" standardStylesheets="false">
<form method="post" name="f1">
<table> <tr>
<td ><font face="Verdana">Your Name</font>
<input type="text" name="p_name">
<a href="javascript:void(0);" NAME="My Window Name" title=" My title here " onClick=window.open("/apex/popupchild?core.apexpages.devmode.url=1","Ratting","width=550,height=170,left=150,top=200,toolbar=1,status=1,"); >Click here to open the child window</a>
</td></tr>
</table>
</form>
</apex:page>
Child(Pop-up) Window:
Name this visualforce page as "popupchild"
<apex:page showheader="false" >
<html>
<head>
<script langauge="javascript">
function post_value(){
opener.document.f1.p_name.value = document.frm.c_name.value;
self.close();
}
</script>
<title>(Type a title for your page here)</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<form name="frm">
<table >
<tr><td align="center"> Your name<input type="text" name="c_name" size="12" value="test"> <input type="button" value="Submit" onclick="post_value();">
</td></tr>
</table></form>
</apex:page>
4 comments
i am facing two error in popupparent page
ReplyDeleteError: popupparent line 10, column 112: Element type "a" must be followed by either attribute specifications, ">" or "/>"
Error: Element type "a" must be followed by either attribute specifications, ">" or "/>".
me also
ReplyDeleteRemove the gap between space and close >
ReplyDeletesaved my day !!!
ReplyDelete