diagram builder vaadin add-on runtime problem

Hello all,

I have problem integrating it into vaadin 7 project. I put all 3 downloaded jars into WEB-INF/lib directory, along with com.fasterxml.jackson.*.jar libs. After successful compilation, I run the project on a tomcat server and encounter the following pop-up window:

Failed to load the widgetset: ./VAADIN/widgetsets/org.
vaadin.diagrambuilder.WidgetSet/org.vaadin.diagrambuilder.WidgetSet.nocache.js?1405669571852 .

The relevant code snippet is as follows.

[code]
private void initDiagram()
{
// Initialize our new UI component
DiagramBuilder diagramBuilder = new DiagramBuilder();
diagramBuilder.setAvailableFields(new NodeType(“diagram-node-start-icon”, “Start”, “start”),
new NodeType(“diagram-node-fork-icon”, “Fork”, “fork”),
new NodeType(“diagram-node-condition-icon”,
“Condition”,
“condition”));
diagramBuilder.setFields(new Node(“StartNode”, “start”, 10, 10), new Node(“Condition”,
“condition”,
260,
16));

    diagramBuilder.setTransitions(new Transition("StartNode", "Condition", "TaskConnector1"));

    final VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    setContent(layout);

    layout.addComponent(diagramBuilder);

}

[/code]I also changed annotation accordingly as follows.

@VaadinServletConfiguration(productionMode = false, ui = VtUI.class, widgetset="org.vaadin.diagrambuilder.WidgetSet")

Did I miss something? Do you have an idea of how to solve this? Any help is appreciated!

Cheers, X.

15601.png

I found there is some problem with the annotation configuration, i.e., @VaadinServletConfiguration(productionMode = false, ui = VtUI.class, widgetset="org.vaadin.diagrambuilder.WidgetSet") for the widgetset here, it should refer to the widgetset of the project, not the widgetset that is used in the project.

However, with this additional bit of knowledge, my diagram builder addon still does not load. Any idea would be appreciated!

See similar question on Stack Overflow, http://stackoverflow.com/questions/24824966/vaadin-add-on-diagram-builder-widgetset-nocache-js-not-found .

Cheers, X.

Your widgetset should inhert the addon widgetset and should be recompiled

https://vaadin.com/book/vaadin6/-/page/addons.compiling.html

[code]

<?xml version="1.0" encoding="UTF-8"?> [/code]My VtWidgetset.gwt.xml file. This inheritances are automatically added while compiling widgetset. Note that I use only Firefox for debugging, so the line about browser choice is as I understand irrelevant here.

But even with all these improvements, I still cannot load diagram builder. I observed some error using Firebug as follows:

"Mon Jul 21 14:04:15 GMT+200 2014 com.vaadin.client.VConsole SEVERE: Exception caught: (TypeError) : $wnd.YUI is not a functioncom.google.gwt.event.shared.UmbrellaException: Exception caught: (TypeError) : $wnd.YUI is not a function at Unknown.Cj(Unknown Source) at Unknown.Jj(Unknown Source) at Unknown.Vw(Unknown Source) at Unknown.Yw(Unknown Source) at Unknown.tw(Unknown Source) at Unknown.mb(Unknown Source) at Unknown.Gpb(Unknown Source) at Unknown.Apb(Unknown Source) at Unknown.hob(Unknown Source) at Unknown.iob(Unknown Source) at Unknown.fob(Unknown Source) at Unknown.Bob(Unknown Source) at Unknown.Fnb(Unknown Source) at Unknown.$l(Unknown Source) at Unknown.Sl(Unknown Source) at Unknown.cm(Unknown Source) at Unknown.Yl(Unknown Source) at Unknown.rl(Unknown Source) at Unknown.wl(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) at Unknown.anonymous(Unknown Source) Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) : $wnd.YUI is not a function I think it is about JavaScript, do you have any idea about it? Any ideas/hints are greatly appreciated! :slight_smile:

Cheers, X.

This looks like a client side GWT exception…probably inside diagrammbuilder. Are you sure the Add-On is working and compatible with your Vaadin version (I couldn’t find it inside the Directory).
If you want to debug the client side or at least show the error in a more human readable way have a look at
https://vaadin.com/book/vaadin7/-/page/clientside.debugging.html

Hi,

The exception looks like you haven’t injected the alloyi scripts to your host page. I have noted it on the github page, but do agree it should be emphasized better.

Check out
this example
(relevant lines emphasized) for a one way to do it.

cheers,
matti