Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8204847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:01:23+00:00 2026-06-07T08:01:23+00:00

Good evening guys, I’m currently trying to add the visualization functionality of d3 to

  • 0

Good evening guys,

I’m currently trying to add the visualization functionality of d3 to my vaadin application. If you don’t know what d3 is, here is a quick link: http://d3js.org/

Yet I am stuck with some problems:

  • How can I add the “d3.v2.js” javascript file/library, that is necessary for developing with d3? I tried adding it to an own theme (WebContent/VAADIN/themes/myOwnTheme/..), but through refreshing in eclipse I’m getting the message: “Errors occurred during the build. Errors running builder ‘JavaScript Validator’ on project ‘VaadinD3Testproject’. 14”. I guess that’s because the js-file might be too large with around 8000 lines ? I read about somehow adding the file to the web.xml? Is there a way?

  • How can I then add javascript code to my vaadin application? After my research I know that there are the options to use:

    • getMainWindow().executeJavaScript(“alert(‘foo’);”)

    or

    • Label test = new Label(“move mouse over here..

      “,Label.CONTENT_XHTML);

–> Are there any other ways to integrate javascript code ?

Could someone help me with an kind of “step by step” explanation, how to solve both ways? Help would really be appreciated here, since I’m not that experienced with this.

——- UPDATE ———–

How can I add the “d3.v2.js” javascript file/library, that is necessary for developing with d3? I tried adding it to an own theme
(WebContent/VAADIN/themes/myOwnTheme/..), but through refreshing I’m
getting the message: “Errors occurred during the build. Errors running
builder ‘JavaScript Validator’ on project ‘VaadinD3Testproject’. 14”.
I guess that’s because the js-file might be too large with around 8000
lines ? I read about somehow adding the file to the web.xml? Is there
a way?

I fixed this error appearing, it was a problem with my eclipse and the inbuild javascript validator. I was now able to load the js-file into my application by overwriting the ajax class with an own servlet, as it has been described here in several posts.

I have now tried several ways:

  • getMainWindow.executeJavaScript() doesn’t work in a way that I could use d3 with, somehow as soon as I want to add some d3 code, like “d3.select(“body”) .append(“svg”);”, it just doesn’t execute it (no matter if I do the tags around or not, but I noticed in general that code in tags wont get executed)

  • I tried using a CustimLayout, as it has been shown in some examples of this forum, but it’s again like described above. When I check the websites sourcecode my code is simply missing or parsed out

  • Labels wont work anymore, no matter if XHTML or RAW mode, exception occures

  • Overwriting another servlet method that is called when the bodys is built at server start, the result was that I got an error message that vaadin couldn’t even load the default widgetset anymore.

So, what’s left? Is there really no way to integrate d3 with vaadin? Did never anyone try this? I read a lot also yesterday about the upcoming vaadin 7. But would it even be kind of an option to use an alpha version from which I have no idea about its stability (I guess that’s why it’s called alpha )

Thanks for every thought you’re sharing with me

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T08:01:24+00:00Added an answer on June 7, 2026 at 8:01 am

    The most comprehensive way to incorporate an existing javascript library is develop your own custom component. This is a little more involved than “normal” Vaadin development, but will give you full access to javascript methods and objects (via GWT) in the browser.

    To just include an external javascript file into the page, extend the ApplicationServlet class, and override the writeAjaxPageHtmlVaadinScripts method. Here is an extract from a current project that includes some external libraries.

    You can then utilise those libraries using ‘getMainWindow().executeJavaScript(blah)’

    Still, from what I can see of d3 it makes more sense to develop a custom Vaadin component. You might find it more prudent to see if there is an existing GWT d3 widget, and then try and utilise that in a Vaadin component.

    @Override
    protected void writeAjaxPageHtmlVaadinScripts(Window window,
                                                  String themeName, Application application, BufferedWriter page,
                                                  String appUrl, String themeUri, String appId,
                                                  HttpServletRequest request) throws ServletException, IOException {
      page.write("<script type=\"text/javascript\">\n");
      page.write("//<![CDATA[\n");
      page.write("document.write(\"<script language='javascript' src='" + appUrl + "/VAADIN/scripts/jquery/jquery-1.4.4.min.js'><\\/script>\");\n");
      page.write("document.write(\"<script language='javascript' src='" + appUrl + "/VAADIN/scripts/highcharts/highcharts.js'><\\/script>\");\n");
      page.write("document.write(\"<script language='javascript' src='" + appUrl + "/VAADIN/scripts/highcharts/modules/exporting.js'><\\/script>\");\n");
      page.write("//]]>\n</script>\n");
      super.writeAjaxPageHtmlVaadinScripts(window, themeName, application,
          page, appUrl, themeUri, appId, request);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good evening guys. I'm currently trying to get started on development of a project
Good evening, here is what I am trying to achieve, I currently have a
Good morning/afternoon/evening guys Here is the thing. I'm making a registering gsp that it
Good evening guys, I'm trying to pass multiple checkbox values through AJAX and process
Good evening, I am currently developing an application for android using phonegap and sencha
Good evening, I'm having trouble with model binding and validation but I don't know
Good evening! I'm currently in the first stages of development with a new application
Good evening guys! I'm currently designing a desktop interface with various features using Firemonkey/FMX.
Good evening, In my app that I'm currently developing, I have a class that
Good evening guys, how can I run a piece of jQuery/ajax when a certain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.