Wednesday, February 26, 2014

Re: GWT and SVG, the 125th... :-)


I have a minimal example now, see below.
I included the JS code as a ClientBundle and also called injectScript:

public class SampleLoader
 public void injectScript()
         String raw = SampleAssetsBundle.instance.myScript().getText();
         ScriptElement e = Document.get().createScriptElement();

To test it, I use this method:

private static native Element testSVG ()
 var draw = SVG('drawing')
 var text = draw.text('SVG.JS').move(300, 0)
          family: 'Source Sans Pro'
        , size: 180
        , anchor: 'middle'
        , leading: 1

 return (draw);  

But when call testSVG I get the following error: (ReferenceError) @wgp.client.lib.GraphicsPanel::test()([]): SVG is not defined

When looking at the svg library (, the method "SVG" should be included, but I cannot find it within the JS file.

So I actually don't know if it is not found for some reason, or doesn't exist or whatever.

What can I do next?


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
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment