How to convert existing JavaScriptObject to java primitive type in GWT?

Suppose I have a link to an existing JavaScriptObject that contains a primitive type, for example an int value, how can I get this int value?

+3
source share
1 answer

Use JSNI to "adapt" between GWT Java and basic Javascript: more specifically, use a method cast()to adapt to the type you want. You can subsequently "repackage" the object to any Java primitive that you want / can.

, native JavascriptObject, "" , . . .

+6

Source: https://habr.com/ru/post/1734426/


All Articles