Re: javascript window.opener not working

2008-11-26 Thread Sumit Chandel
Hi gabidp,

I believe the reason why you're unable to access the opener attribute
defined on the $wnd object is because of the way you're creating the popup
in the first open(url, name, options) call.

The reason why we keep the $wnd reference around is because GWT applications
load up in their own iframe, meaning that references to the regular window
object are local to the iframe rather than the body of the page.

By calling open(url, name, options), you're actually invoking
window.open(url, name, options) from within the iframe context. This means
that the popup might also limited to the same scope, so references to $wnd
attrributes won't resolve.

Try replacing the open(url, name, options) call by $wnd.open(...) and see if
that works.

Hope that helps,
-Sumit Chandel

On Mon, Nov 24, 2008 at 5:30 AM, gabidp [EMAIL PROTECTED] wrote:


 Hi!

 I have a window which opens a popup with a native javascript method:
public static native void open_new_window(String url, String name,
 String options) /*-{
 open(url, name, options);
}-*/;

 This new window has a button, and when someone clicks it, I want to do
 something on the original window with this function:
  public native void test()
/*-{
$wnd.opener.document.forms[0].testForm.value = AA
}-*/;

 The problem seems to be that $wnd.opener does not reference my
 original window. How can I do that?

 Thank you!
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



javascript window.opener not working

2008-11-24 Thread gabidp

Hi!

I have a window which opens a popup with a native javascript method:
public static native void open_new_window(String url, String name,
String options) /*-{
 open(url, name, options);
}-*/;

This new window has a button, and when someone clicks it, I want to do
something on the original window with this function:
  public native void test()
/*-{
$wnd.opener.document.forms[0].testForm.value = AA
}-*/;

The problem seems to be that $wnd.opener does not reference my
original window. How can I do that?

Thank you!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---