6

I have Object that I wish to pass from JavaScript to Java in GWT app.

This object may have arbitary fields. So it is different from very similar question were only number is passed. Passing javascript parameter from external javascript to java

I define callback like

public static void cbSysInfoSucces(JavaScriptObject o1) {
}

But I do not know how to convert JavaScriptObject to JSONObject

Could you also advice on $entry() function format if I wish to pass Object to java

Community
  • 1
  • 1
Eugene
  • 257
  • 1
  • 6

2 Answers2

7

Use constructor JSONObject(JavaScriptObject jsValue) to create a new JSONObject from the supplied JavaScript value.

Braj
  • 46,415
  • 5
  • 60
  • 76
1

I had same problem week ago and I have not found answer to that question. I simply encoded object as string and passed it to Java

Max
  • 6,286
  • 5
  • 44
  • 86