title: JSNI call a Java method with a Long param
body: <p>I need to call a Java method from Javascript. So I defined  the method:</p>
  
  <pre><code>private native void registerMethod() /*-{
      var self = this;
      $wnd.test = function(longParam) {
          self.@mypackage.HomeView::test(Ljava/lang/Long;)(longParam);
      };
  }-*/;
  </code></pre>
  
  <p>The Java method:</p>
  
  <pre><code>private void test(Long longParam) {
      GWT.log("Call to test with longParam =  " + longParam);
  }
  </code></pre>
  
  <p>The JS call:</p>
  
  <pre><code>public static native void paypalClose() /*-{
      $wnd.alert(top.test);
      top.test(10);
      top.dgFlow.closeFlow();
      top.close();
  }-*/;
  </code></pre>
  
  <p>The alert shows the Javascript function definition. If I call <code>top.test()</code>, it works but no param is passed. But if I call <code>top.test(10)</code> I get a null alert window.</p>