View Full Version : problem with opener window

06-12-2007, 08:51 PM
I'm fairly new to javascript.
I have a calling window that has a popup window. The sequence of events should be:
1 - click Add New button on calling window
2 - click on hyperlink which brings up the popup
3 - select a record from popup, which then closes the popup, and sends some data back to calling window.
4 - fill in rest of data on calling window, click Save button

All works fine the first time I add a record. After selecting a record on the popup window the second time, the Save button does not fire, nor does any other actions.

Here is the code from my calling window:

string scr1 = @"<script>
var win1;

function openCustomer(){
win1 = open('../Common/popupCustomerParent.aspx',null,'left=300, top=100, height=600, width= 800, status=no, resizable= no, scrollbars= yes, toolbar= no,location= no, menubar= no');

function updateCustomer(elemValue)
Sys.WebForms.PageRequestManager.getInstance()._doPostBack( '" + lnkbtnChooseCustomerParent.ClientID + "', 'updateDropDown' ); win1.close(); window.opener.focus(); " +
"} </script>";

I tried window.opener.location.reload() and that didn't work either. The odd thing is that it did work once with the location.reload and once with the focus, but stopped working in both scenarios.

Can anyone help?? I'm going crazy!