static method returns wrong value

8 views
Skip to first unread message

ihsan ciftci

unread,
Oct 26, 2011, 11:57:56 AM10/26/11
to gwtexporter
I have method

@Export("$wnd.name")
public static String name()
{
Window.alert("Test");
return "ABC";
}

This method is added to window as String

' function(' bla bla bla ) '

not method as
function( bla bla bla );

so alert(name()) will make no effect,
but alert(name) will print the function string.



Manuel Carrasco Moñino

unread,
Oct 27, 2011, 11:32:43 AM10/27/11
to gwtex...@googlegroups.com
You can not use 'name' because it is a reserved word for the object window.

GwtExporter tries to do:
window.name = function() ....
but window.name is always a string, so the function is passed as a string,

Use a name for your method which is not already in the window object

- Manolo

Reply all
Reply to author
Forward
0 new messages