Alan53
(Alan McSherry)
April 16, 2020, 3:42pm
1
Is there a Vaadin 14 component for a simple [edit: range]
slider?
i.e. without porting polymer or using “compatibility mode”?
I can’t find one, in which case when will one be available?
Or what are the disadvantages if any of using “compatibility mode”? (Assuming I can get an out-of-the-box slider with compatibility mode)
Thanks for reading!
Hi,
I’m not sure of what is a slider component for you. Is it a range slider ( like this one https://vaadin.com/directory/component/paper-range-slider or a carousel like that https://vaadin.com/directory/component/carousel-addon ?
The first one is running in compatibility mode but it should be easy to upgrade it in vaadin 14 because the polymer component already exists in polymer 3.
Alan53
(Alan McSherry)
April 16, 2020, 6:40pm
3
Hi,
A range slider.
So … I use Vaadin because I don’t keep up to date with polymer etc.
Given that, how would one go about porting to latest Vaadin 14?
Checkout, change the vaadin version, and go from there?
Also, where would the Polymer 3 version be?
ty.
I did a mistake and the range-slider component has not been upgraded to Polymer3. So the link for the component is not “easy” to migrate.
You can find an example of a simple slider here: https://vaadin.com/docs/v14/flow/binding-data/tutorial-flow-field.html
You can also add some properties (like max or pin)
@Tag("paper-slider")
@NpmPackage(value = "@polymer/paper-slider",
version = "3.0.1")
@JsModule("@polymer/paper-slider/paper-slider.js")
public class PaperSlider
extends AbstractSinglePropertyField<PaperSlider,
Integer> {
public PaperSlider() {
super("value", 0, false);
}
public void setMax(int max) {
this.getElement().setProperty("max", max);
}
public void setPin(boolean pin) {
this.getElement().setProperty("pin", pin);
}
}
But I don’t think there is already a Vaadin 14 component for that.
Alan53
(Alan McSherry)
April 17, 2020, 9:16am
5
Boom! Works.
“Acid for blood …”
You’ve been extremely helpful, many thanks.
mavi1
(Martin Vyšný)
April 24, 2024, 12:30pm
7