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(th...@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:
- there should be a "." between "that" and "@fr.gouv.finances.…": that.@fr.gouv.finances.…
- 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) { ... });