Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reference to a showModelessDialog from a different window

Status
Not open for further replies.

ThorO

Programmer
Sep 28, 2002
20
NO
Hello guys

I have a problem with understand how to 'find' a showModelessDialog from a different window. What I want to do is using a showModelessDialog in a printtemplate to give users a status on whats going on. I have a document in a frameset which open a showModelessDialog e.g.
winref = showModelessDialog(bla..bla)
Then I open a different window (or the printtemplate does) and then I need to e.g. close the showModelessDialog window from the 'new' window.

Any suggestions?

Thanks in advance
Thor
 
try using the opener reference:


So in your situation, you have a window a, it opens up a modeless dialog box and assigns it to a variable called winref, it then opens up a new window b. In window b you should be able to use the following code to reference the variable called winref:
Code:
var newWinRef = opener.window.winref
from there you can do whatever you could normally do to the modeless box - like close it:
Code:
newWinRef.close();

-kaht

How much you wanna make a bet I can throw a football over them mountains?
sheepico.jpg
 
Hello kath and thanks for reply. I am sorry to inform that this did not work. I think that the print-preview window which the templateprinter use also is a sort of showModeDialog and that has restrictions. I will try to ask the guys who made the Printtemplate we use, and hopefully they can answer.

Thanks for your time

Thor
 
I have come a step further and now understand that the printtemplate (which is a completly separate window) has many restrictions, so I am not able to run anything from the printtemplate. I can however change the value of a variable from the document that has winref and hope that someone can give me a clue on how I can set up a sort of eventhandler that can trigger when a certain variable change and from that point I can call the winref.close() or whatever I want.

I have testet with onchange etc., but they do not fire of when I from a different window change their values.

Does anybody have a suggestion?

Thanks in advance
Thor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top