Here's how I solved it with JSNI:

public class AppLoader implements EntryPoint {

   private String url, name, features;

   public void onModuleLoad() {
      initDownload();
      Window.open(url, name, features);
   }

   private static void download(String arg) {
      //The arg string now contains stuff from the other browser
window.
      Window.alert("Communication across browser windows was
successfull!");
   }

   public static native void initDownload() /*-{
      $wnd.download = function(arg) {
         @<packagepath>.AppLoader::download(LJava/lang/String;)(arg);
      };
   }-*/;
}

public class AppTest implements EntryPoint {

   String arg;

   public void onModuleLoad() {
      if (windowHasParent()) {
         submit(arg);
         close();
      } else {
         Window.alert("Please enter app by clicking link ... blah
blah");
      }
   }

   private native boolean windowHasParent() /*-{
      if ($wnd.opener == null) {
         return false;
      } else {
         return true;
      }
   }-*/;

   private native void submit(String arg) /*-{
      $wnd.opener.download(arg);
   }-*/;

   private native void close() /*-{
      $wnd.close();
   }-*/;

}

So basically the AppLoader module is loaded in page 1 and pops up page
2 where the AppTest module is loaded. AppTest sends back any form data
the user entered to AppLoader in page 1. From there AppLoader can send
a formpanel to server to get the response in an iframe.

All the best,

Anders


On Mar 15, 11:23 am, Thomas Broyer <[email protected]> wrote:
> On Mar 11, 12:29 am, Anders <[email protected]> wrote:
>
> > Sorry, not for this one. The formpanel needs to be in a separate
> > browser window. So I'm basically interested in knowing how to set the
> > response target for a formpanel to be in another browser window (I
> > would guess this needs some JSNI).
>
> No need for JSNI, FormPanel can be constructed with a "target browsing
> context 
> name":http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/g...)
>
> The javadoc is a bit misleading as you actually pass a name that could
> match either the name of an iframe, or the name of a window (for
> instance, one that has been previously opened with Window.open(...)),
> or one of the "special names" _self, _top, _blank, _parent, etc.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
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.

Reply via email to