On Wednesday, September 21, 2011 3:00:06 PM UTC+2, Christophe wrote:
>
> Hi,
>
> I have a compilation problem with a 'javascript' native methid, but I
> can not find the problem.
If it doesn't compile, there must be an error message. They're generally
useful for debugging.
> Can someone help ?
>
> public native void defineJS() /*-{
> var that = this;
> $wnd.modifyTabTitle = function(title) {
>
> $entry(t...@fr.gouv.finances.dgfip.xemelios.web2.gwt.client.widgets.navigate.PnlShowDocument::__modifyTabTitle(Ljava/
>
>
> lang/String;)(title));
> };
> }-*/;
>
Don't know what the issue is, but there are two issues here, a syntax one,
and a bug:
1. there should be a "." between "that" and "@fr.gouv.finances.…":
[email protected].…
2. the $entry() is not correctly used: $entry() wraps a function so that
calling the returned function executes the scheduledEntry and
scheduledFinally commands, and route exceptions through the
GWT.UncaughtExceptionHandler; but here you're wrapping the return value of
your method, after calling it, and you don't use the return value of
$entry(); so it's useless.
Best is to wrap your anonymous function with $entry: $wnd.modifyTabTitle
= $entry(function(title) { ... });
--
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/-/K0Mf5Cb3IS0J.
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.