Third Party Vaadin Component

Hi, I’m in the advanced stages of our app development and I’ve hit a brick wall trying to integrate a third party Vaadin component (I’m on the latest Cuba Platform). So I followed your guide at https://doc.cuba-platform.com/manual-latest/vaadin_addon_sample.html in order to test the stepper component, and I get the following message on the screen where the stepper should appear:

Here is the portion of my build.gradle file:

configure(webModule) {
    configurations {
        webcontent
    }

    dependencies {
        compileOnly(servletApi)
        compile(globalModule)
        compile 'com.google.zxing:core:3.5.0'
        compile 'com.google.zxing:javase:3.5.0'
        compile 'org.vaadin.addons:stepper:2.4.0'
    }

And my AppWidgetSet.gwt.xml:

<?xml version="1.0" encoding="UTF-8"?>
<module>
    
    <inherits name="com.haulmont.cuba.web.widgets.WidgetSet" />

    <inherits name="org.vaadin.risto.stepper.StepperWidgetset" />

    <set-property name="user.agent" value="safari" />

</module>

I have cleaned and rebuilt the project numerous times to no effect. I even added the following line manually to the web-app.properties file based on an existing support request:

cuba.web.widgetSet=com.gektron.pp.web.toolkit.ui.AppWidgetSet

But it produced the following error on application startup:

Also referring to https://forum.cuba-platform.com/t/integrating-stepper-into-the-generic-ui/5124/12 the following folder does not exist \deploy\tomcat\webapps\app\VAADIN\widgetsets… I have underplayed but this hasn’t helped either. Is there any other sort of additional compilation I need to do? It’s as if my application doesn’t recognise the web-toolkit or the widgetset.

Please could you help urgently as this will potentially hold up further development as I’m looking to integrate other third party components.

Hi,
There is a working sample for the Stepper integration:

Have you created the web-toolkit module beforehand in the project?

Yes I did create the module. I followed the documentation at https://doc.cuba-platform.com/manual-latest/vaadin_addon_sample.html to the letter.

Thanks for the link to the sample, indeed it runs correctly. However I created a simple test project from scratch (platform 7.2.20) and it still didn’t work.

After comparing the source code of your sample with mine I noticed 2 massive omissions from my project (which I would have thought would be created automatically or at least documented). First the whole configure(webToolkitModule) section in the build.gradle file had not been created, so I copied yours (changing the path to the WidgetSet of course).

configure(webToolkitModule) {
    dependencies {
        compile(webModule)
    }

    jar {
        from sourceSets.main.allJava
    }

    task buildWidgetSet(type: CubaWidgetSetBuilding) {
        widgetSetClass = 'com.gektron.pp.web.toolkit.ui.AppWidgetSet'
    }

    task debugWidgetSet(type: CubaWidgetSetDebug) {
        widgetSetClass = 'com.gektron.pp.web.toolkit.ui.AppWidgetSet'
    }

    task webArchive(dependsOn: buildWidgetSet, type: Jar) {
        from file("$buildDir/web")
        classifier = 'client'
    }

    artifacts {
        archives webArchive
    }

    task deploy(dependsOn: webArchive, type: Copy) {
        from webArchive
        into "$cuba.tomcat.dir/webapps/${modulePrefix}/WEB-INF/lib"
    }
}

One question though, is everything in this section required as I must admit I’m not an expert by any means when it comes to build configurations.

The second omission was this line in the web-app.properties file. Again it was not created automatically and the documentation made no reference to it being required.

cuba.web.widgetSet=com.gektron.pp.web.toolkit.ui.AppWidgetSet

Finally I noticed a GUI issue when updating your sample to the latest platform (7.2.20). Originally your sample shows the stepper arrows correctly, but after the update I get this:

Screenshot 2023-07-21 at 16.56.12

Any ideas why the arrows disappear? Also as a bonus would you be able to provide styling for the helium theme?

Many thanks as always.