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_deta ils"].location; // Global, set
onload
: : :
function showDetails()
{
if (selectRef.sele ctedIndex == 0) //First line is a Header line
return false;
detailLoc.reloa d(); // 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["cornucopia e"].document.getEl ementById("Corn uCopiae");
try
{
selectRef =
parent.frames["queue_look up"].document.getJo bs.jobList;
getDetails();
}
catch(err)
{initData()};
}
function getDetails()
{
headColor =
parent.frames["cornucopia e"].document.getEl ementById("tors o").style.backg rou
ndColor;
parent.frames["cornucopia e"].document.getEl ementById("tors o").style.backg rou
ndColor = "Silver";
document.displa y.entryNumber.v alue =
selectRef.optio ns[selectRef.selec tedIndex].text.substring (0,
10);
return true;
}
function goBack()
{
selectRef.optio ns[selectRef.selec tedIndex].selected=false ;
parent.frames["cornucopia e"].document.getEl ementById("tors o").style.backg rou
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.********@gma il.comwrote in message
news:11******** **************@ n59g2000hsh.goo glegroups.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