Thanks, Sébastien. I tested. These are the results (again, from within the 
modal window's iframe page, mywin.php, see my original message below):

top.Windows.getWindow('modal_window') alerts as [object Object]. (So far, so 
good)

top.Windows.getWindow('modal_window').setURL('http://www.yahoo.com')
and
top.Windows.getWindow('modal_window').getURL()
both throw a JS error:
top.Windows.getWindow('modal_window').s/getURL() is not a function

I tried top.Windows.getWindow('modal_window').Window.getURL()
and got a JS error as well:
top.Windows.getWindow("modal_window").Window has no properties

Any other suggestions? I'd be very surprised if no one has tried this 
before.

Many thanks,
Adam

----- Original Message ----- 
From: Sébastien Gruhier
To: [email protected]
Sent: Thursday, February 22, 2007 10:50 AM
Subject: Re: [Javawin] getURL(), setURL()


Not tested but it sshould be something like this


top.Windows.getWindow('modal_window').setURL(your_url);


On Feb 21, 2007, at 5:59 PM, Adam Alexander wrote:


Hello. I'm new to PWC, and trying to figure something out, but while I 
understand the existing API online documentation, I can't find usage 
examples, and thus am running into issues. For instance, I've opened a new 
modal window:

function openModal()
{
 var win = new Window('modal_window', {className: "modalWin", title: "", 
url: "mywin.php", width:345, height:300})

 win.showCenter();
 win.setDestroyOnClose();
 win.show(true);
}

mywin.php has two buttons, one for closing the modal window, one to replace 
the the current modal's url with another url.

I was eventually able to figure out that the JS to close the modal window is 
parent.Windows.closeAll(). This was not obvious from the documentation, but 
I got it. (Is there a more appropriate way to do this?)

However, I cannot figure out the second task, replacing the current url with 
another. I figure if I can successfully call getURL, then setURL will work. 
>From within mywin.php, I've tried alerting:
getURL()
parent.getURL()
top.getURL()
Window.getURL()
parent.Window.getURL()
top.Window.getURL()
Windows.getURL()
parent.Windows.getURL()
top.Windows.getURL()

But none of those work. Help!

~ Adam


_______________________________________________
Javawin mailing list
[email protected]
http://mail.xilinus.com/mailman/listinfo/javawin_xilinus.com

Reply via email to