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?
Supposing that I have a reference to an existent JavaScriptObject that holds a primitive
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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
nativemethod on a sub-class of JavascriptObject in order to “reach” the primitive type you are referring to. See this article for more details.