473,226 Members | 1,220 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

window.opener lost in postback

Hello everyone,

I have a problem that the window.opener variable is lost once my popup
page has a postback. On multiple pages they address this problem but I
cannot find a correct answer.

This is my situation:

I have a main page which shows invoices. When a user clicks on the
invoices they get a popup where they can alter the invoice which uses
postbacks because of direct changes in the database. Finally the user
can click a button to accept the invoice and then I need to change two
variables on the main page which opened this popup, the new invoice
fee and status (which is based on the button pressed). I dont want any
postbacks on the main page, therefore I simply want to pass these two
variables from the popup to the main page.

However, after a single postback on the popup page the window.opener
variable is gone and lost forever. Now I have seen solutions using
frames but I do not know how to go from there because I also pass some
variables from the main page to the popup.

Hope someone can help me,
Regards Frank

Mar 30 '07 #1
4 8149
"Frank" <f.********@gmail.comwrote in message
news:11**********************@n59g2000hsh.googlegr oups.com...
Hello everyone,

I have a problem that the window.opener variable is lost once my popup
page has a postback. On multiple pages they address this problem but I
cannot find a correct answer.

This is my situation:

I have a main page which shows invoices. When a user clicks on the
invoices they get a popup where they can alter the invoice which uses
postbacks because of direct changes in the database. Finally the user
can click a button to accept the invoice and then I need to change two
variables on the main page which opened this popup, the new invoice
fee and status (which is based on the button pressed). I dont want any
postbacks on the main page, therefore I simply want to pass these two
variables from the popup to the main page.

However, after a single postback on the popup page the window.opener
variable is gone and lost forever. Now I have seen solutions using
frames but I do not know how to go from there because I also pass some
variables from the main page to the popup.

Hope someone can help me,
Regards Frank
If you are able to capture the variables in the popup then you could get
those in a framepage as well... right?
in the window.onload of one of the frame pages you can use window.parent to
get javascript variables from... the parent...
even after a reload/submit you'll be able to get those but only if the
target of the form submit is 'self' of course...

search for window.parent
(or perhaps window.top to get easy access to the top frame instead of
parent.parent.parent which I have seen people doing...)
Mar 30 '07 #2
Hi Frank,
However, after a single postback on the popup page the window.opener
variable is gone and lost forever. Now I have seen solutions using
frames but I do not know how to go from there because I also pass some
variables from the main page to the popup.
FWIW this is how I "pass" (tell the details frame to "receive" parameters)
If there is a better way please let me know. It's not very modular but hey
:-)

Main Page (With scrolling select list of Invoices)
================================

detailLoc = parent.frames["entry_details"].location; // Global, set
onload
: : :

function showDetails()
{
if (selectRef.selectedIndex == 0) //First line is a Header line
return false;

detailLoc.reload(); // Trigger the onload event in the details
form - a bit kludgy?
parent.document.getElementById("main").rows="30px, 0px,*"; // Show the
details form
return true;
}

Details Page
========

function load()
{
chan =
parent.frames["cornucopiae"].document.getElementById("CornuCopiae");

try
{
selectRef =
parent.frames["queue_lookup"].document.getJobs.jobList;
getDetails();
}
catch(err)
{initData()};

}

function getDetails()
{
headColor =
parent.frames["cornucopiae"].document.getElementById("torso").style.backgrou
ndColor;

parent.frames["cornucopiae"].document.getElementById("torso").style.backgrou
ndColor = "Silver";
document.display.entryNumber.value =
selectRef.options[selectRef.selectedIndex].text.substring(0,
10);
return true;
}

function goBack()
{
selectRef.options[selectRef.selectedIndex].selected=false;

parent.frames["cornucopiae"].document.getElementById("torso").style.backgrou
ndColor = headColor;
parent.document.getElementById("main").rows="30px, *,0px";
return;
}

You (I) have to use the try/catch because when the "real" load of the
details page occurs, context and some variables are unavailable but when I
reload() they are.

Cheers Richard Maher

"Frank" <f.********@gmail.comwrote in message
news:11**********************@n59g2000hsh.googlegr oups.com...
Hello everyone,

I have a problem that the window.opener variable is lost once my popup
page has a postback. On multiple pages they address this problem but I
cannot find a correct answer.

This is my situation:

I have a main page which shows invoices. When a user clicks on the
invoices they get a popup where they can alter the invoice which uses
postbacks because of direct changes in the database. Finally the user
can click a button to accept the invoice and then I need to change two
variables on the main page which opened this popup, the new invoice
fee and status (which is based on the button pressed). I dont want any
postbacks on the main page, therefore I simply want to pass these two
variables from the popup to the main page.

However, after a single postback on the popup page the window.opener
variable is gone and lost forever. Now I have seen solutions using
frames but I do not know how to go from there because I also pass some
variables from the main page to the popup.

Hope someone can help me,
Regards Frank

Mar 31 '07 #3
Thanks Marc and Richard,
I will try to use the frames idea to save the variables. I tried it
once but it didnt work out, guess I'll have to try again!

Regards,
Frank

Apr 6 '07 #4
Help !

Well I tried to use frames. I currently have the mainwindow,
factuurOverzicht which opens a new window onclick, which is a frameset
called: factuurFrameset. In this frameset I pass the variables in the
querystring to the frame inside this frameset and load factuur.aspx
with the variables needed. This goes fine. Also, in the mainwindow
factuurOverzicht I set the opener of the factuurFrameset to
factuurOverzicht. Furthermore, from the frame factuur.aspx I can call
window.top.opener and retreive the opener for factuurOverzicht.

However, after I submit data to factuur.aspx (which is handled in
codebehind), such as for editing e.a., the frames and all still work
but I loose the window.top.opener. What could be wrong?

Regards,
Frank

On 6 apr, 11:37, "Frank" <f.f.nee...@gmail.comwrote:
Thanks Marc and Richard,
I will try to use the frames idea to save the variables. I tried it
once but it didnt work out, guess I'll have to try again!

Regards,
Frank

Apr 8 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Andrew Alger | last post by:
ok i have two forms. Customer.aspx and Parent_Searh.aspx. There is a button on Customer.aspx that when executed runs javascript code to open up parent_search as a popup. After the user searches...
0
by: Todd | last post by:
I am doing some coding in a popup page which is kicked off from a parent page (of course). When clicking on the Save button in the popup, I am attempting to do some validation, save some data, and...
1
by: MrFez | last post by:
I have an webform from which I open a child window to display a calendar. When a date is selected in the calendar window it attempts to set the value of a textbox in the main (parent) window by...
5
by: Jay | last post by:
I have a situation where the user clicks on a button in a DataGrid to launch a popup window via javascript. In the popup window the user does some things that result in changes to the underlying...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
4
by: louise raisbeck | last post by:
I have this scenario (simplified) function addnewdata () { check for partial match already in db for information entered by user if (partialmatch succeeds) { open new window aspx page (using...
0
by: Peter Morris [Droopy eyes software] | last post by:
Hi all I have a form which pops open from my page. This form asks the user to enter some values which are then validated on the server. The problem is that the window.opener seems to be lost...
1
by: MrFez | last post by:
I have an webform from which I open a child window to display a calendar. When a date is selected in the calendar window it attempts to set the value of a textbox in the main (parent) window by...
7
by: MrFez | last post by:
Through some investigation it appears that selecting "Every visit to the page" for the IE caching setting "Check for new version of stored pages" causes the window.opener property of child windows...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.