Re: GWT JSNI Callback

2012-06-08 Thread Chris Price
I'd assumed the bulk landing of messages was due to them being held in
a new-poster queue until being approved (normally on a Friday
morning)?

On Fri, Jun 8, 2012 at 8:55 PM, Joseph Lust  wrote:
> On May 30th, I submitted a reply. It then appeared as 'Deleted' in the
> thread. I rewrote it and submitted again. Then the next day it was undeleted
> and appeared in the web interface. Since I then had two of them, I deleted
> the first, but never deleted it on the 30th. Something wonky on their
> backend.
>
> Even weirder, on May 30th, I went from having 0 unread message on the group
> to a week's worth (all the way back to May 24th). You'll notice that a very
> large number of posts appeared from no where that day that no body had
> replied to yet and had no views, since they were living in some parallel
> universe until then.
>
> I wonder if it has to do with the 'eventual consistency' of DataStore on
> AppEngine? Anyway, I concur the groups interface can behave in odd ways.
>
>
>
> Joe
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-web-toolkit/-/6Mq6aZK5JMUJ.
>
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.

-- 
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 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT JSNI Callback

2012-06-08 Thread Joseph Lust
On May 30th, I submitted a 
reply.
 
It then appeared as 'Deleted' in the thread. I rewrote it and submitted 
again. Then the next day it was undeleted and appeared in the web 
interface. Since I then had two of them, I deleted the first, but never 
deleted it on the 30th. Something wonky on their backend.

Even weirder, on May 30th, I went from having 0 unread message on the group 
to a week's worth (all the way back to May 24th). You'll notice that a very 
large number of posts appeared from no where that day that no body had 
replied to yet and had no views, since they were living in some parallel 
universe until then.

I wonder if it has to do with the 'eventual consistency' of DataStore on 
AppEngine? Anyway, I concur the groups interface can behave in odd ways.



Joe

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/6Mq6aZK5JMUJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT JSNI Callback

2012-06-08 Thread zorro
Yep, You are right. No need for my callback to be JSO. Prevopisly I was 
passing it to another callback, oh no.
I need only call callback as $wnd.gwt.executeCallback(callback, param); and 
the example you gave applies.
Thanks


Dne pátek, 8. června 2012 14:09:43 UTC+2 Thomas Broyer napsal(a):
>
>
>
> On Friday, June 8, 2012 2:04:37 PM UTC+2, zorro wrote:
>>
>> "gwt-2.4.0/doc/helpInfo/jsoRestrictions.html" comes with GWT 
>> distribution. So far best readable document on the topic. However, a bit of 
>> disappointment. b/c It implies I can not implement callbacks in a neat way 
>> and in general.
>>
>> The example you pointed me two days ago is no more relevat, since it 
>> breaks all the RULES.
>>
>> https://code.google.com/p/gwt-in-the-air/source/browse/trunk/src/net/ltgt/gwt/browserplus/core/client/BrowserPlus.java#145
>>
>
> Not as long as Callback is not a JSO.
>  
>
>> From gwt-2.4.0/doc/helpInfo/jsoRestrictions.html:
>>
>> 4. JSO classes cannot have instance fields. -- this is waht callbacks 
>> are about.
>>
>> 2. An interface type may be implemented by at most one JSO subtype. -- 
>> this excludes possibility of having a general interface for callbacks
>>
>>
> Why the hell are you trying to have your callback extend JavaScriptObject 
> ?!
>
> Maybe you need to give more details on what you're trying to achieve.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/uYcqe0HooeoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT JSNI Callback

2012-06-08 Thread Thomas Broyer


On Friday, June 8, 2012 2:04:37 PM UTC+2, zorro wrote:
>
> "gwt-2.4.0/doc/helpInfo/jsoRestrictions.html" comes with GWT 
> distribution. So far best readable document on the topic. However, a bit of 
> disappointment. b/c It implies I can not implement callbacks in a neat way 
> and in general.
>
> The example you pointed me two days ago is no more relevat, since it 
> breaks all the RULES.
>
> https://code.google.com/p/gwt-in-the-air/source/browse/trunk/src/net/ltgt/gwt/browserplus/core/client/BrowserPlus.java#145
>

Not as long as Callback is not a JSO.
 

> From gwt-2.4.0/doc/helpInfo/jsoRestrictions.html:
>
> 4. JSO classes cannot have instance fields. -- this is waht callbacks are 
> about.
>
> 2. An interface type may be implemented by at most one JSO subtype. -- 
> this excludes possibility of having a general interface for callbacks
>
>
Why the hell are you trying to have your callback extend JavaScriptObject ?!

Maybe you need to give more details on what you're trying to achieve.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/ys-0hlfMjGIJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT JSNI Callback

2012-06-08 Thread zorro
"gwt-2.4.0/doc/helpInfo/jsoRestrictions.html" comes with GWT distribution. 
So far best readable document on the topic. However, a bit of 
disappointment. b/c It implies I can not implement callbacks in a neat way 
and in general.

The example you pointed me two days ago is no more relevat, since it breaks 
all the RULES.
https://code.google.com/p/gwt-in-the-air/source/browse/trunk/src/net/ltgt/gwt/browserplus/core/client/BrowserPlus.java#145
 

>From gwt-2.4.0/doc/helpInfo/jsoRestrictions.html:

4. JSO classes cannot have instance fields. -- this is waht callbacks are 
about.

2. An interface type may be implemented by at most one JSO subtype. -- this 
excludes possibility of having a general interface for callbacks

What this implies is that anythig more complex in JSNI boils down to 
TRAMPOLINE METHODS. Ugly. A lots of boilerplate code. 
The otherwise "closured" instance fileds (See 4. above) now have to be 
static Java fileds on the trapoline. (Trampoline is not very 
flexible/dynamic thing indeed) 


Dne pátek, 8. června 2012 9:57:09 UTC+2 Thomas Broyer napsal(a):
>
>
>
> On Friday, June 8, 2012 12:54:48 AM UTC+2, zorro wrote:
>>
>> Regarding callbacks there is one more error I am getting:
>> Only one JavaScriptObject type may implement the methods of an interface 
>> that declared methods.
>>
>> This
>> gwt-2.4.0/doc/helpInfo/jsoRestrictions.html
>> explains alot. But why nobody tell me that in the past? I mean tutorials, 
>> talks?
>>
>>
> You mean 
> https://developers.google.com/web-toolkit/doc/latest/DevGuideCodingBasicsOverlay
>  ?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/M1YX8ISGOhcJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT JSNI Callback

2012-06-08 Thread zorro
Yeap, the interface is a bit couterintuitive thanks to Czech translation 
that I am seeing. "Publicise your answer" should be "Reply publicly". 
Anyway.

Dne pátek, 8. června 2012 9:52:56 UTC+2 Thomas Broyer napsal(a):
>
>
>
> On Friday, June 8, 2012 12:19:57 AM UTC+2, zorro wrote:
>>
>> This Google Groups interface is F* HORRIBLE. I send a response and it 
>> disappears as I never send it.
>
>
> You probably clicked "Reply to Author", as I received the mail in my 
> inbox, sent to me only, not the group.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/PnUAphDk6zEJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT JSNI Callback

2012-06-08 Thread Thomas Broyer
On Fri, Jun 8, 2012 at 12:15 AM, zorro  wrote:
> I am getting, when compiled with TRACE
> Error, ... references to instance methods in overlay types are illegal; use
> a stronger type or a Java trampoline method
>
> From the compiler output I found out there is:
> gwt-2.4.0/doc/helpInfo/jsoRestrictions.html
>
> There is no link to this from
> https://developers.google.com/web-toolkit/doc/latest/DevGuideCodingBasicsJSNI

Because JSOs have their own section in the Dev Guide:
https://developers.google.com/web-toolkit/doc/latest/DevGuideCodingBasicsOverlay

In this case, see
http://code.google.com/p/google-web-toolkit/wiki/OverlayTypes#Restrictions
(linked to at the bottom of the above-mentioned page):
“Native JSNI methods may not refer to instance methods within
@SingleJsoImpl types, just as they may not refer to instance methods
on overlay types.”
(note that @SingleJsoImpl doesn't actually exist, it was in an earlier
iteration, now the GWT Compiler infers it from how it's actually being
used)

What it means is that if you have a JavaScriptObject subclass
com.example.client.Foo with a "public final bar()" method (native or
not), you cannot write in JSNI:
   someo...@com.example.client.foo::bar()();
This is due to how JSOs are handled by the compiler: all methods are
transformed into static methods, they're not instance methods on the
JavaScript object (a JSO is just a Java "view" of a JS object).

> btw, What is "trampoline method"? Sounds good;-)

public static void trampoline_to_bar(Foo foo) {
  foo.bar();
}

Then you can use in JSNI:
@com.example.client.Trampoline::trampoline_to_bar(Lcom/example/client/Foo;)(someObj);

-- 
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 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT JSNI Callback

2012-06-08 Thread Thomas Broyer


On Friday, June 8, 2012 12:54:48 AM UTC+2, zorro wrote:
>
> Regarding callbacks there is one more error I am getting:
> Only one JavaScriptObject type may implement the methods of an interface 
> that declared methods.
>
> This
> gwt-2.4.0/doc/helpInfo/jsoRestrictions.html
> explains alot. But why nobody tell me that in the past? I mean tutorials, 
> talks?
>
>
You mean 
https://developers.google.com/web-toolkit/doc/latest/DevGuideCodingBasicsOverlay
 ?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/HGkIQXZJyRQJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT JSNI Callback

2012-06-08 Thread Thomas Broyer


On Friday, June 8, 2012 12:19:57 AM UTC+2, zorro wrote:
>
> This Google Groups interface is F* HORRIBLE. I send a response and it 
> disappears as I never send it.


You probably clicked "Reply to Author", as I received the mail in my inbox, 
sent to me only, not the group.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/yYNyLqyLrfUJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT JSNI Callback

2012-06-07 Thread zorro
Regarding callbacks there is one more error I am getting:
Only one JavaScriptObject type may implement the methods of an interface 
that declared methods.

This
gwt-2.4.0/doc/helpInfo/jsoRestrictions.html
explains alot. But why nobody tell me that in the past? I mean tutorials, 
talks?


Dne pátek, 8. června 2012 0:17:03 UTC+2 zorro napsal(a):
>
>
>
> Dne úterý, 5. června 2012 3:42:36 UTC+2 zorro napsal(a):
>>
>> I am trying to implement a callback using JSNI. 
>>  1. I don't know if changing "this" is allowed in the way I do it.
>>  2. I don't know if such an assignment is advisable from the perspective 
>> of JSNI functionality
>>  3. The compiler in Eclispe does not seem to grasp that as well and I 
>> don't know the right syntax 
>>
>> for
>> this.@com.roamtopix.client.StaticFacad.JsCallback::callback.execute(Lcom/google/gwt/core/client/JavaScriptObject;)(jsObject);
>>  with 
>> "callback.execute" it says 
>> "JavaScript parsing: Missing ) after argument list"
>>
>> for 
>> this.@com.roamtopix.client.StaticFacad.JsCallback::callback::execute(Lcom/google/gwt/core/client/JavaScriptObject;)(jsObject);with
>>  
>> "callback::execute" it says
>> "JavaScript parsing: Invalid label"
>>
>> public static interface JavaCallback {
>> void execute(JavaScriptObject jsObject);
>> } 
>>  public static class JsCallback extends JavaScriptObject {
>> public final JavaCallback callback;
>>  public JsCallback(JavaCallback callback){
>> this.callback = callback;
>> init();
>> }
>>  private native void init()/*-{
>>
>> this.@com.roamtopix.client.StaticFacad.JsCallback::that(Lcom/google/gwt/core/client/JavaScriptObject;)(this);
>> }-*/; 
>>  private native void that(JavaScriptObject that)/*-{
>> var fn = function(jsObject) { 
>>
>> this.@com.roamtopix.client.StaticFacad.JsCallback::callback.execute(Lcom/google/gwt/core/client/JavaScriptObject;)(jsObject);
>> };
>> that = $entry(fn);
>> }-*/; 
>> }
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/HUAfkHHKRz8J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT JSNI Callback

2012-06-07 Thread zorro
I just wrote that I got a Compiler Error, using TRACE 

saying: 
references to instance methods in overlay types are illegal; use a stronger 
type or a Java trampoline method

But compilation succeeds.

Dne úterý, 5. června 2012 11:37:24 UTC+2 Thomas Broyer napsal(a):
>
>
>
> On Tuesday, June 5, 2012 3:42:36 AM UTC+2, zorro wrote:
>>
>> I am trying to implement a callback using JSNI. 
>>  1. I don't know if changing "this" is allowed in the way I do it.
>>
>
> No.
> BTW, you're not doing much.
>  
>
>>  2. I don't know if such an assignment is advisable from the perspective 
>> of JSNI functionality
>>
>
> No.
>  
>
>>  3. The compiler in Eclispe does not seem to grasp that as well and I 
>> don't know the right syntax 
>>
>> for
>> this.@com.roamtopix.client.StaticFacad.JsCallback::callback.execute(Lcom/google/gwt/core/client/JavaScriptObject;)(jsObject);
>>  with 
>> "callback.execute" it says 
>> "JavaScript parsing: Missing ) after argument list"
>>
>> for 
>> this.@com.roamtopix.client.StaticFacad.JsCallback::callback::execute(Lcom/google/gwt/core/client/JavaScriptObject;)(jsObject);with
>>  
>> "callback::execute" it says
>> "JavaScript parsing: Invalid label"
>>
>
>
> var callback = this.@com.roamtopix.client.StaticFacad.JsCallback::callback;
>
> callback.@com.roamtopix.client.StaticFacad.JavaCallback::execute(Lcom/google/gwt/core/client/JavaScriptObject;)(jsObject);
>
> But there's simpler.
> It depends how you (intend to) use your callback though.
> Have a look at 
> https://code.google.com/p/gwt-in-the-air/source/browse/trunk/src/net/ltgt/gwt/browserplus/core/client/BrowserPlus.java#145(the
>  createNativeCallback method) for a way of wrapping a Java callback 
> into a JS function to be passed as a "callback" to some API.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/7xGqG96zQoIJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT JSNI Callback

2012-06-07 Thread zorro
This Google Groups interface is F* HORRIBLE. I send a response and it 
disappears as I never send it. So now what is it out there or not? Wasn't 
this written in GWT?

Dne pátek, 8. června 2012 0:17:03 UTC+2 zorro napsal(a):
>
>
>
> Dne úterý, 5. června 2012 3:42:36 UTC+2 zorro napsal(a):
>>
>> I am trying to implement a callback using JSNI. 
>>  1. I don't know if changing "this" is allowed in the way I do it.
>>  2. I don't know if such an assignment is advisable from the perspective 
>> of JSNI functionality
>>  3. The compiler in Eclispe does not seem to grasp that as well and I 
>> don't know the right syntax 
>>
>> for
>> this.@com.roamtopix.client.StaticFacad.JsCallback::callback.execute(Lcom/google/gwt/core/client/JavaScriptObject;)(jsObject);
>>  with 
>> "callback.execute" it says 
>> "JavaScript parsing: Missing ) after argument list"
>>
>> for 
>> this.@com.roamtopix.client.StaticFacad.JsCallback::callback::execute(Lcom/google/gwt/core/client/JavaScriptObject;)(jsObject);with
>>  
>> "callback::execute" it says
>> "JavaScript parsing: Invalid label"
>>
>> public static interface JavaCallback {
>> void execute(JavaScriptObject jsObject);
>> } 
>>  public static class JsCallback extends JavaScriptObject {
>> public final JavaCallback callback;
>>  public JsCallback(JavaCallback callback){
>> this.callback = callback;
>> init();
>> }
>>  private native void init()/*-{
>>
>> this.@com.roamtopix.client.StaticFacad.JsCallback::that(Lcom/google/gwt/core/client/JavaScriptObject;)(this);
>> }-*/; 
>>  private native void that(JavaScriptObject that)/*-{
>> var fn = function(jsObject) { 
>>
>> this.@com.roamtopix.client.StaticFacad.JsCallback::callback.execute(Lcom/google/gwt/core/client/JavaScriptObject;)(jsObject);
>> };
>> that = $entry(fn);
>> }-*/; 
>> }
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/DdPNLkAYdMYJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT JSNI Callback

2012-06-07 Thread zorro


Dne úterý, 5. června 2012 3:42:36 UTC+2 zorro napsal(a):
>
> I am trying to implement a callback using JSNI. 
>  1. I don't know if changing "this" is allowed in the way I do it.
>  2. I don't know if such an assignment is advisable from the perspective 
> of JSNI functionality
>  3. The compiler in Eclispe does not seem to grasp that as well and I 
> don't know the right syntax 
>
> for
> this.@com.roamtopix.client.StaticFacad.JsCallback::callback.execute(Lcom/google/gwt/core/client/JavaScriptObject;)(jsObject);
>  with 
> "callback.execute" it says 
> "JavaScript parsing: Missing ) after argument list"
>
> for 
> this.@com.roamtopix.client.StaticFacad.JsCallback::callback::execute(Lcom/google/gwt/core/client/JavaScriptObject;)(jsObject);with
>  
> "callback::execute" it says
> "JavaScript parsing: Invalid label"
>
> public static interface JavaCallback {
> void execute(JavaScriptObject jsObject);
> } 
>  public static class JsCallback extends JavaScriptObject {
> public final JavaCallback callback;
>  public JsCallback(JavaCallback callback){
> this.callback = callback;
> init();
> }
>  private native void init()/*-{
>
> this.@com.roamtopix.client.StaticFacad.JsCallback::that(Lcom/google/gwt/core/client/JavaScriptObject;)(this);
> }-*/; 
>  private native void that(JavaScriptObject that)/*-{
> var fn = function(jsObject) { 
>
> this.@com.roamtopix.client.StaticFacad.JsCallback::callback.execute(Lcom/google/gwt/core/client/JavaScriptObject;)(jsObject);
> };
> that = $entry(fn);
> }-*/; 
> }
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/0mxVLVhUY48J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT JSNI Callback

2012-06-05 Thread Thomas Broyer


On Tuesday, June 5, 2012 3:42:36 AM UTC+2, zorro wrote:
>
> I am trying to implement a callback using JSNI. 
>  1. I don't know if changing "this" is allowed in the way I do it.
>

No.
BTW, you're not doing much.
 

>  2. I don't know if such an assignment is advisable from the perspective 
> of JSNI functionality
>

No.
 

>  3. The compiler in Eclispe does not seem to grasp that as well and I 
> don't know the right syntax 
>
> for
> this.@com.roamtopix.client.StaticFacad.JsCallback::callback.execute(Lcom/google/gwt/core/client/JavaScriptObject;)(jsObject);
>  with 
> "callback.execute" it says 
> "JavaScript parsing: Missing ) after argument list"
>
> for 
> this.@com.roamtopix.client.StaticFacad.JsCallback::callback::execute(Lcom/google/gwt/core/client/JavaScriptObject;)(jsObject);with
>  
> "callback::execute" it says
> "JavaScript parsing: Invalid label"
>


var callback = this.@com.roamtopix.client.StaticFacad.JsCallback::callback;
callback.@com.roamtopix.client.StaticFacad.JavaCallback::execute(Lcom/google/gwt/core/client/JavaScriptObject;)(jsObject);

But there's simpler.
It depends how you (intend to) use your callback though.
Have a look 
at 
https://code.google.com/p/gwt-in-the-air/source/browse/trunk/src/net/ltgt/gwt/browserplus/core/client/BrowserPlus.java#145
 
(the createNativeCallback method) for a way of wrapping a Java callback 
into a JS function to be passed as a "callback" to some API.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/3RJnhZ4JhhoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



GWT JSNI Callback

2012-06-04 Thread zorro
I am trying to implement a callback using JSNI. 
 1. I don't know if changing "this" is allowed in the way I do it.
 2. I don't know if such an assignment is advisable from the perspective of 
JSNI functionality
 3. The compiler in Eclispe does not seem to grasp that as well and I don't 
know the right syntax 

for
this.@com.roamtopix.client.StaticFacad.JsCallback::callback.execute(Lcom/google/gwt/core/client/JavaScriptObject;)(jsObject);
 with 
"callback.execute" it says 
"JavaScript parsing: Missing ) after argument list"

for 
this.@com.roamtopix.client.StaticFacad.JsCallback::callback::execute(Lcom/google/gwt/core/client/JavaScriptObject;)(jsObject);with
 
"callback::execute" it says
"JavaScript parsing: Invalid label"

public static interface JavaCallback {
void execute(JavaScriptObject jsObject);
} 
 public static class JsCallback extends JavaScriptObject {
public final JavaCallback callback;
 public JsCallback(JavaCallback callback){
this.callback = callback;
init();
}
 private native void init()/*-{
this.@com.roamtopix.client.StaticFacad.JsCallback::that(Lcom/google/gwt/core/client/JavaScriptObject;)(this);
}-*/; 
 private native void that(JavaScriptObject that)/*-{
var fn = function(jsObject) { 
this.@com.roamtopix.client.StaticFacad.JsCallback::callback.execute(Lcom/google/gwt/core/client/JavaScriptObject;)(jsObject);
};
that = $entry(fn);
}-*/; 
}


-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/O_buDgbx1PYJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.