Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT object parameter from javascript to java (JavaScriptObject to JSONObject)

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

like image 315
Eugene Avatar asked Feb 27 '14 17:02

Eugene


1 Answers

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

like image 164
Braj Avatar answered Nov 01 '22 04:11

Braj