title: How to pass javascript object to GWT method and parse result
body: <p>I have this GWT method:</p>
  
  <pre><code>public static native JavaScriptObject getJsValue() /*-{
      var res = $wnd.product; 
      return res;
  }-*/;
  </code></pre>
  
  <p>This is the HTML/JS part:</p>
  
  <pre><code>&lt;script type="text/javascript" language="javascript"&gt;
      var product = products({id:1}).first(); 
  &lt;/script&gt; 
  &lt;!-- GWT --&gt;
  &lt;script type="text/javascript" language="javascript" src="app/app.nocache.js"&gt;&lt;/script&gt; 
  </code></pre>
  
  <p>The object <code>product</code> looks like this in Firebug:</p>
  
  <pre><code>Object { id=1, categoryid=0, name="Sample Product", more...}
  </code></pre>
  
  <p>After then,</p>
  
  <pre><code>Object obj = getJsValue();  // what cast? 
  </code></pre>
  
  <p>However, how can I parse the resulting value to get the field values like the product id, etc.? </p>