title: Pass value from GWT to Javascript via JSNI
body: <p>I've been trying to pass a value into a Javascript method through JSNI but it keeps on failing.</p>
  
  <p>Is this method valid:</p>
  
  <pre><code>public static native JavaScriptObject getProductById(long pid) /*-{
      var productId = pid;
      var product = $wnd.products({id:productId}).first();    
      return product;
  }-*/;
  </code></pre>
  
  <p>I can say that the JS method is correct, since if I put a constant value in place of <code>productId</code>, I get the correct output. </p>
  
  <p>What am I missing?</p>