Thursday, September 25, 2014

XMLHttpRequest: invalid response when loading data from Client Bundle

Hello,

I am trying to load a SVG file using the Snap SVG library:

public class GraphicsBoardWidget ...
{ ...
 private void testLoad ()
 {
  String u = GraphicsResources.instance.bb ().getSafeUri ().asString ();
  testLoad (u);
 }
 
 private native void testLoad (String url)
 /*-{
  var obj = this.@awi.client.vgi.gui.SnapGraphicsWidget::obj; 
  
  var t = $wnd.Snap.load (url,function (e) { obj.append (e);} );

 }-*/;
 ... 
}

Here Snap.load is a JS library function which expects a file argument, and GraphicsResources.instance.bb is a DataResource in a ClientBundle:

public interface GraphicsResources extends ClientBundle
{
 ...
 @Source("bb.svg")
 DataResource bb ();
 ...
}

The call to Snap.load then leads to an error:


How can I get this to work?

Thanks
Magnus

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment