Hi,

you may run into browser incompatibilities and security issues with
such an approach.

Did you consider to pass the object via the url. Maybe as query part?

Stefan Bachert
http://gwtworld.de

On Jun 16, 7:21 pm, keyvez <[email protected]> wrote:
> Hi,
>
> I am trying to pass a custom Java object to the another window to
> which I have a reference using $wnd.opener.
>
> When I call $wnd.opener.callback(); or $wnd.opener.callback('string'),
> it works, however, when I pass
> $wnd.opener.callback(@com.package.Class::staticField), the staticField
> is received as null by callback.
>
> Here's my code:
>
> Main Window:
>
> -----------------------------------------------------
>     public native void registerCallback() /*-{
>         $wnd.callback =
> $entry(@com.application.web.client.Tv::javaCallback(Lcom/application/
> web/model/User;));
>     }-*/;
>
>     public static void javaCallback( User registeredUser ) {
>
>         Window.alert(Boolean.toString(registeredUser == null));
>         Window.alert(user.getFirstname());
>
>     }
> -----------------------------------------------------
> Child Window:
> -----------------------------------------------------
>      Window.addWindowClosingHandler(new ClosingHandler() {
>
>             @Override
>             public native void onWindowClosing( ClosingEvent event ) /
> *-{
>                if($wnd.opener != null) {
>                     alert('sending request');
>                     var obj =
> @com.application.web.authentication.OAuth::registeredUser;
>                     $wnd.opener.callback(obj);
>                }
>             }-*/;
>       });
> -----------------------------------------------------
>
> Any help is appreciated.
>
> Thanks,

-- 
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