tags:

views:

118

answers:

1

Supposing that I have a reference to an existent JavaScriptObject that holds a primitive type, like an int value, how can I get this int value?

+1  A: 

Use the JSNI functionality to "adapt" between GWT's Java and underlying Javascript: more specifically, use the cast() method to adapt to the desired type. You can afterwards "repackage" the object to any Java primitive you want/can.

You might need to write a native method on a sub-class of JavascriptObject in order to "reach" the primitive type you are referring to. See this article for more details.

jldupont