Widgetset Compilation

Example code is available on github.com/vaadin-on-grails/widgetset-compilation.

This article shows how to recompile widgetset when we add an add-on that requires widgetset recompilation.

We will demonstrate how to add tokenfield. But you can use this tutorial in the same way for the other add-ons as well.

Step 1

Add the depedencies to add-ons in BuildConfig.groovy.

repositories {
    inherits true

    grailsPlugins()
    grailsHome()
    mavenLocal()
    grailsCentral()
    mavenCentral()

    mavenRepo "http://maven.vaadin.com/vaadin-addons"
}

dependencies {
    compile "org.vaadin.addons:tokenfield:7.0.1"
}

Step 2

Create src/java/app/widgetset.gwt.xml file with widgetset references.

If you want to add more add-ons, just add more lines with widget sets.

Step 3

Add the widgetset reference into VaadinConfig.groovy.

We can try to run the application in order to see that the application will not come up. That will show that widgetset compilation is mandatory.

Step 4

We will add a text field on UI. Use TokenField in order to finish this example.

Step 5

Run grails vaadin-compile-widgetset --verbose to recompile the widgetset.

Step 6

After the widgetset compilation is done and you run the application, you will see the tokenfield component in the browser.

Valo theme customized

Last updated

Was this helpful?