Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Vaadin 7.7 widgetset configuration in case of custom widget
I have a project which has a custom widget and is also using addon widgets.
Now I am wondering what can be removed/changed after switching from 7.6 to 7.7.
Removing the @Widgetset annotation from my UI class worked - Vaadin is detecting the AppWidgetset.gwt.xml file automatically.
However, since switching to 7.7, the widgetset compilation modifies the gwt.xml file of my custom widget, by adding all addons:
<module> <inherits name="com.vaadin.DefaultWidgetSet" /> <inherits name="org.vaadin.addons.locationtextfield.LocationTextFieldWidgetSet" /> <inherits name="org.vaadin.peter.contextmenu.ContextmenuWidgetset" /> <inherits name="org.vaadin.addon.vol3.WidgetSet" /> <inherits name="org.vaadin.gridutil.WidgetSet" /> </module>
Is this normal? Now I have the addon inherits in both the AppWidgetset as well as in the widgetset of my custom component.
Next, I tried to remove the AppWidgetset.gwt.xml, however my custom widgets are not being displayed afterwards. Instead, it shows "Widgetset 'com.vaadin.DefaultWidgetSet' does not contain implementation for mypackage.MultiSelectCalendar". Should custom widgets work without the AppWidgetset or not?
And do I need the AppWidgetset.gwt.xml anyways if I want to enable use superdevmode?
Would be great if somebody could clarify what's still necessary if one has custom widgets.
If you have a custom widget in your project, it should be in its own submodule, and not depend on the addons (unless specifically needed). Your UI module should then depend on the custom widget module and the addons you are using. This way the UI module will generate and compile the AppWidgetset with the correct dependencies. Take a look at the multimodule archetype for Vaadin 7.7.0, it has an example of this. The widgetset for the custom widget should not be touched, as it a dependency for the UI, but the UI module should not need a widgetset and annotation.
thank you very much for the explanation. I tried to follow your suggestion and seperate the widget into an own module.
I can also see the loading bar at the top, which never finished. My custom widget is not displayed on the page, but a defualt widget is (see attached image).
I have created an almost minimal test project and uploaded it to github.
VMultiSelectCalendarWidget is a custom widget which should show a calendar with multiselect support (basically an adjusted copy of the default calendar widget).
To run the application, I first executed mvn clean install on the parent module, then spring-boot:run on the ui module.
Any idea what could be wrong or further hints how I could debug this issue?
Nevermind, the issue was caused by a NullPointer in one of the methods which is called by @DelegateToWidget...