Monday, June 17, 2019

Re: JSNI - access inner class attribute from external JS?

On Monday, June 17, 2019 at 5:15:26 AM UTC-5, Jens wrote:
Your setValue() method must be static if you want to call it that way. If it must be an instance method you need to write barInstance.@pkg.Foo.Bar::method (don't forget the dot after instance variable)

-- J.
Thanks for your help Jens.  Is there some documentation that explains this syntax to any degree?  All I can find is this and it isn't enough -

I've tried what you describe but when I call it from my external javascript I get an error indicating that the function I'm calling is not defined.  It passes the GWT compiler but at runtime it can't find the function.  I feel like the syntax isn't correct but I'm not seeing it.  Should "Bar" be the instance name of the internal class within the outer class?  I tried that too, same result.

Here is the updated native method:

public native void setValueFromExternal(int newValue) /*-{

The call from the external javascript file is still the same:

function setValue(value){


You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

No comments:

Post a Comment