and the github url to the component, since I saw a webinar “Webinar: How to create components for Vaadin 10?” where they did exactly that (at 24:26), which is
https://github.com/Link2Twenty/l2t-paper-rating
But the textfields validator excpects: Must be of type @vaadin/vaadin-radio-button@^1.2.3
I don’t seem to be able to get any of the rating-stars’ish components from the vaadin component directory to run. With the one mentioned above I felt like I was getting close though.
HorizontalLayout layout = new HorizontalLayout();
RatingStars ratingStars = new RatingStars();
layout.add(ratingStars); <- Static code analyses shows error here
gives
java: no suitable method found for add(org.vaadin.teemu.ratingstars.RatingStars)
method com.vaadin.flow.component.HasComponents.add(com.vaadin.flow.component.Component...) is not applicable
(varargs mismatch; org.vaadin.teemu.ratingstars.RatingStars cannot be converted to com.vaadin.flow.component.Component)
method com.vaadin.flow.component.HasComponents.add(java.lang.String) is not applicable
(argument mismatch; org.vaadin.teemu.ratingstars.RatingStars cannot be converted to java.lang.String)
RatingStars is an AbstractField
The java-doc to AbstractField says
An abstract implementation of a field, or a {@code Component} allowing user
input. Implements {@link HasValue} to represent the input value. Examples of
typical field components include text fields, date pickers, and check boxes.
To be able to just import components with @NpmPackage and @JsModule without having to fiddle with JavaScript Dependencies and their dependencies in maven / gradle feels like such a blessing and great feature.