Grails+Vaadin plugin+MultiButton addon

Hello everyone.
I’m trying to use such configuration. Addon is compiled locally to jar-file, jar is put to “lib” directory.
When I try to open page (vaadin panel with MultiButton on it and several other standard Vaadin visual components) all components work fine except MultiButton which draws error:

Widgetset does not contain implementation for org.vaadin.peter.multibutton.MultiButton. Check its @ClientWidget mapping, widgetsets GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions. Unrendered UIDL:

etc.

Would anyone please make some advice on what’s going on?

Thanks in advance.

P.S. Vaadin 6.4.3 if it’s important.

Hi

You need to recompile your widgetset in order to include addon client part into it.

  1. Create your widgetset file
    in /grails-app/vaadin (if you use vaadin plugin) or /src/java or /src/groovy

e.g.: com.company.app.YourWidgetset.gwt.xml


<module>

	<inherits name="com.vaadin.terminal.gwt.DefaultWidgetSet" />

        <!-- insetr proper addon widgetset here -->
        <inherits name="your.addon.Widgetset" />    
</module>
  1. You need to modify default widgetset compilation script (found in distrinbution)
    You may use the one i use in my grails progect (see attachment)
    Place it into grails project root and correct path to your widgetset:

Set GWT_HOME enviroment variable pointing to gwt distribution folder or set it explicitly by modifying property

Now call

ant compile-widgetset

Note: i have vaadin library in /lib/vaadin-*.jar … if you have different location, you should set correctly vaadin-jar-location property in script.
11419.xml (7.78 KB)

Hi
i did as described, but error still remains

this IS my…

create file
\grails-app\vaadin\org.vaadin.peter.multibutton.MultibuttonWidgetset.gwt.xml

component source
\grails-app\vaadin\org.…

script for ant
build.xml

widgetsets are compiled to:
\web-app\VAADIN\widgetsets\org.vaadin.peter.multibutton.MultibuttonWidgetset\

ant compile-widgetset - Compilation succeeded

what am I doing wrong ?

Oh, i’m sorry, i forget to mention - you need to say application to use your widgetset :slight_smile:

But first, a little note: i assume that org.vaadin.peter.multibutton is multibutton addon package.
Actually you could use your own package, because it’s your own widgetset.
You just need to add multibutton widgetset dependency inside xml.

You need to correct vaadin plugin in order to enable this
open /plugins/vaadin-1.2.2/VaadinGrailsPlugin.groovy

Note: by default grails use system user folder to store plugins. To move plugins inside the project set
grails.project.plugins.dir = “./plugins”
in BuildConfig.groovy

Find servlet parametrs set section and add widgetset parameter declaration. Should look like:


[b]
def widgetset = config.widgetset
[/b]

servlets[servlets.size() - 1]
 + {
            "servlet" {
                "servlet-name"(servletName)
                "servlet-class"(applicationServlet)
                "init-param" {
                    "description"("Vaadin application class to start")
                    "param-name"("application")
                    "param-value"(vaadinApplicationClass)
                }

               [b]
"init-param" {
                                    "description"("Application widgetset")
                                    "param-name"("widgetset")
                                    "param-value"(widgetset)
                }
[/b]

                "load-on-startup"("1")

Now specify widgetset in VaadinConfig.groovy (inside vaadin section, like applicationClass):

widgetset = "org.vaadin.peter.multibutton.MultibuttonWidgetset"

Hi
i did as described, but error still remains.
Perhaps, I do something wrong.

Ok, lets check

Make your widgetset name different from multibutton one, e.g.
com.yourcompany.yourapp.MyWidgetset.gwt.xml

Your widgetset content is:





Now compile widgetset with ant script. Look into ant log: it should contain all client widget names that it found. MultiButoon should be in this list.

In VaadinConfig.groovy:
widgetset = “com.yourcompany.yourapp.MyWidgetset”

Also you should read book of vaadin, if i remember correctly chapter 10 describes widgetset compilation.
(i’ve used only book and example in vaadin distribution to add widgetset support for my grails progject)

If you want, you can attach your project (or create smaple one) and i will look where is the problem.

I did the following:

  1. Downloaded add-on jar
  2. Placed next to vaadin.jar in /lib
  3. Added line to MyWidgetset.xml
  1. Added line to VaadinConfig.groovy

    widgetset = “com…MyWidgetset”

  2. modified the above attached ant script

6, Tried to compile using ant, but it can’t find the TreetableWidgetset.gwt.xml within the jar file.

I don’t see a logical line to change with the ant file, am I going about this wrong with the jar file?

It would be helpful to have clearer instructions on how to add a Vaadin addon to a Grails project. This thread is the only information on the subject that I could find and it is quite ambiguous. Longer term, someone needs to modify the Vaadin Grails plugin so that it can install Vaadin add-ons in one step. It should not be this difficult.

Hi,

here is the tutorial that I have made after successful add-on integration with Grails project:

http://ondrej-kvasnovsky.blogspot.com/2011/08/how-to-add-vaadin-add-on-into-grails.html

It might be useful for some of you…

Ondra.