Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Slider as a Form field
my version of Vaadin is 6.6.6
What I want to do is add a slider to a form with DefaultFieldFactory
the peace of code in CreateField method is
else if ("days".equals(propertyId)) {
final Slider slider = new Slider(1, 100);
try {
slider.setValue(new Double(5.0));
} catch (ValueOutOfBoundsException e) {
}
slider.setOrientation(Slider.ORIENTATION_HORIZONTAL);
return slider;
}
I am getting an error for that code
java.lang.NullPointerException at com.vaadin.ui.Slider.paintContent(Slider.java:426)
target.addVariable(this, "value", ((Double) getValue()).intValue());
value is null !
Am I doing anything wrong ?
Ok, that was my fault (partly?), after I've set a default double value for the corresponding field in a bean which is a data source for that Form, everything worked clearly
I would say the problem is that the Form sets the value of Slider to null, i.e. the days field is null in your bean. The NPE in this case sounds like a bug in Slider.