0

I'm using Vaadin 7.6.3 with Spring Boot. I'm trying to use the PopupButton add-on (but I don't think the issue is specific to the add-on).

I added the add-on as a dependency to gradle. This is the code for creating a PopupButton:

PopupButton btn = new PopupButton("Test Button");
btn.setContent(new Label("Test"));
layout.addComponent(btn);

Via the Vaadin plugin for Gradle I ran the task vaadinCompile which created the file src/main/resources/addon/client/ListaideWidgetset.gwt.xml and serveral files in src/main/webapp/VAADIN/gwt-unitCache and src/main/webapp/VAADIN/widgetsets/addon.client.ListaideWidgetset. I also added @Widgetset("addon.client.ListaideWidgetset") to my UI. I confirmed that the widgetset is used via the client's ?debug mode.

Content of ListaideWidgetset.gwt.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Vaadin//DTD Vaadin 7//EN" "https://raw.github.com/vaadin/gwt/master/distro-source/core/src/gwt-module.dtd">
<!-- WS Compiler: manually edited -->
<module>
        <inherits name="com.vaadin.DefaultWidgetSet" />
        <set-configuration-property name="devModeRedirectEnabled" value="true" />
        <set-property name="user.agent" value="ie8,ie9,gecko1_8,safari,ie10" />
        <source path="client" />
        <source path="shared" />
        <collapse-all-properties />
        <set-property name="compiler.useSymbolMaps" value="true" />
</module>

The problem is that on the client the button shows up as a standard button (no chevron) and doesn't open a popup when clicked.

Erik Hofer
  • 2,296
  • 2
  • 18
  • 39

1 Answers1

1

Your widgetset does not contain the addon. See the the example:

 <inherits name="org.vaadin.hene.popupbutton.widgetset.PopupbuttonWidgetset" />

Once added, recompile the widgetset, restart your application.

Usually the gradle plugin can handle this for you, but that feature can be disabled and or some other configuration error could prevent it. Hard to tell without the build.gradle...

edit

The gradle vaadin plugin seems not to be able to handle this addon properly. As a workaround disable the automatic management for widgetset, which prevents regeneration of the gwt.xml. See manageWidgetset in https://github.com/johndevs/gradle-vaadin-plugin/wiki/Tasks-and-configuration-DSL). E.g. add vaadinCompile.manageWidgetset = false in your vaadin{}-block.

Community
  • 1
  • 1
cfrick
  • 35,203
  • 6
  • 56
  • 68
  • When I add that line to the widgetset and run `vaadinCompile` the widgetset gets overriden and reset to the original one O.o This is my [gradle.build](http://pastebin.com/UmrktUmB). – Erik Hofer Jul 29 '16 at 11:19
  • @zero_cool first of all, the current version of the vaadin gradle plugin is 0.11.1. if the plugin does not properly handle the plugins, you might have to disable widgetset management (see `manageWidgetset` in https://github.com/johndevs/gradle-vaadin-plugin/wiki/Tasks-and-configuration-DSL) – cfrick Jul 29 '16 at 13:16
  • 1
    I updated to 0.11.1 which didn't do anything. I added `vaadinCompile.manageWidgetset = false` to build.gradle. Now the widgetset doesn't get overridden anymore. The add-on is also working now. Thanks a million :) – Erik Hofer Aug 03 '16 at 12:23