Vaadin 7 - Script tag in GWT module

Hi All,

I have been using ProtovisGWT (http://code.google.com/p/choosel/wiki/ProtovisGWT) module in vaadin 6.
I wanted to try it with Vaadin 7 alpha 3 unfortunately I am not able to compile the widgetset.

Reason being my GWT module (Protovis.gwt.xml) file has a script tag in it. (Which includes the of Protovis js file).
Am I missing something or Vaadin 7 doesn’t allow the scripts tags even in the GWT modules ??


Linking into WebContent\VAADIN\widgetsets
      Invoking Linker Cross-Site-Iframe
         [ERROR]
 The Cross-Site-Iframe linker does not support <script> tags in the gwt.xml files, but the gwt.xml file (or the gwt.xml files which it includes) contains the following script tags: 
js/protovis-3.2-PATCHED/protovis-d3.2-PATCHED-COMPRESSED.js

Any information will be appreciated.

Thanks,
Deepak

It appears that the GWT cross site iframe linker currently used by Vaadin 7 alpha 3 does not support script tags in the widgetset xml file (or in any inherited module definition). You will need to remove the script tags from the Protovis.gwt.xml and instead use the
new Javascript API
introduced in Vaadin 7 alpha3 to load the Protovis library.

This is really bad news for me. I have to re-write lot of my visualizations (Vaadin 6) which use GWT modules.
Any workaround for this problem (of course other than rewriting the entire thing) ??

Any suggestions will be really helpful and greatly appreciated !!

The only thing you need to rewrite is to move the script names/paths from your .gwt.xml file to @JavaScript annotations on your components. In addition to that, you may need to move the script files to a location where they can be found by the annotation (either absolute URL or on the classpath of the component - I believe the javadoc or mini-tutorial should have more details).

If the script annotations are used in third party libraries you are using, you might need to edit the GWT module files in their JARs.

Or another approach: you could try for now to replace the “xsilinker” in DefaultWidgetSet with the old “xs” linker which does support tags.

It may or may not work with Vaadin 7 and at least SuperDevMode will not work with it, but maybe worth a try.

Thanks for filing this ticket.
http://dev.vaadin.com/ticket/9111

-Deepak

Sorry, newbie here. New to Vaadin 7 AND to GWT. I would like to use raphael4gwt in a custom component I am writing for use in Vaadin application. I posted the following on the raphael4gwt forum, but maybe you folks are more suited to spell out more precisely where I go to get the missing .js files and where more precisely I should put them in my Eclipse foodchain for testing/use in my component.

Sorry I am new to GWT and Vaadin 7, so hopefully this will be an easy question. I am trying to make a custom Vaadin widget using raphael4gwt. When I go to compile the widget in Eclipse using Vaadin’s widget compiler, I get an error :

[ERROR]
The Cross-Site-Iframe linker does not support tags in the gwt.xml files, but the gwt.xml file (or the gwt.xml files which it includes) contains the following script tags:
raphael-min.js,
raphael4gwt-all-min.js
In order for your application to run correctly, you will need to include these tags in your host page directly.

The Vaadin forum (https://vaadin.com/forum/-/message_boards/view_message/1552277) says I can get around the problem as follows: “move the script names/paths from your .gwt.xml file to @JavaScript annotations on your components”

The only thing I have in the .gwt.xml file relating to raphaelgwt is this:

I don’t know where to find the raphael-min.js and raphael4gwt-all-min.js, files and what the URLs should be to put in the @Javascript annotation as described in Vaadin’s JavaDoc:
Example: @JavaScript( “http://host.com/file1.js”, “file2.js”)} on the class com.example.MyConnector would load the file http://host.com/file1.js as is and file2.js from /com/example/file2.js on the server’s classpath using the ClassLoader that was used to load com.example.MyConnector.

I presume I have to put them someplace that makes both raphael4gwt widget and Vaadin happy.

Thanks VERY much in advance for help. I’d hate to have to abandon all the great functionality of raphael and raphael4gwt and write it all from scratch. That would be a VERY big job indeed.

Henri,
Sorry, I should’ve posted my earlier reply to you instead of Deepak. Can you help me?

This parameter allows using script tags in module file when using xsiframe.

    <set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>