title: From javascript to java (A GWT story)
body: <p>So, I'm designing an app in GWT for an embedded web browser (Sketchup).  I can control Sketchup by changing the window.location value to "skp::myFunciton@myParams".  Sketchup can execute javascript in the browser.  What I want to do is ask sketchup to give me the contents of its model.</p>
  
  <pre><code>public static native void getModel() /*-{
      $wnd.location = "skp:getModel@";
  }-*/;
  </code></pre>
  
  <p>After a second sketchup has a result.  But how do we get it back to gwt?  The problem is the entrypoint instance launched the request and JSNI can only map static methods to javascript.</p>
  
  <p>I thought I had a solution with events and elements...</p>
  
  <pre><code>//Sketchup javascript
  var gwtwidget = document.getElementById("myTextArea")
  gwtwidget.value = "blahblah";
  gwtwidget.onchange();
  </code></pre>
  
  <p>and then listening for the change in GWT.  Alas, it doesn't work.  Gwt's own event system overrides, sinks, deters (or whatever) the event.  What approach should I take?  I've been through the web in search of info but I certainly can't get my head round it.  I'm guessing the answer is either...</p>
  
  <p>1 Call an entrypoint instance method from javascript (somehow)<br>
  2 Fire an event from javascript that will be picked up by gwt (somehow)<br>
  3 Setup an async callback interface mechanism of sorts (somehow)</p>