Yes, i didn't use addEventListener. But i has a similar usage:
Java
Bus.subscribe(String topic, Handler<? extends Message> handler);
<https://github.com/goodow/realtime-channel/blob/master/src/main/java/com/goodow/realtime/channel/Bus.java#L108>
translated to js
bus.subscribe("some/topic", function(message) {
var body = message.body();
console.log("Name: " + body.name);});
On Tue, Jul 22, 2014 at 5:41 PM, Henrik <[email protected]> wrote:
> A bonus issue, I saw you did not use addEventListener like the demo does,
>>> and I really struggled to make it work. The generated javascript looks
>>> like "addEventListener('click', new xxx(this))" which doesn't work (the key
>>> thing here being "new" I'd guess). I found no other way to call it
>>> directly and eventually resorted to doing it from a jsni function instead:
>>> public static native void jsAddEventListener(Element elem,
>>> String event, EventListener listener) /*-{
>>> elem.addEventListener(event, function(ev) { listener.onEvent(ev); });
>>> }-*/;
>>>
>>
>> Which demo uses addEventListener?
>>
>
> https://www.youtube.com/watch?v=wFMD1GXR2Tg#t=190
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google Web Toolkit" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-web-toolkit/fGIr4sRkz7s/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.