JFXtras / jfxtras

A supporting library for JavaFX, containing helper classes, extended layouts, controls and other interesting widgets.
http://jfxtras.org
Other
599 stars 123 forks source link

CalendarTimePicker sliders do not always update the underlying calendar #13

Closed Drakkoon closed 9 years ago

Drakkoon commented 9 years ago

Hi,

If you click on a slider to select the time instead of sliding the thumb to the desired value on the hours/minutes/seconds sliders in a CalendarTimePicker, the calendarProperty does not get updated.

This all seems to stem from the fact that the Slider's valueChangingProperty does not fire if you don't grab the thumb (probably a bug in JavaFX: RT-17276, RT-17277, RT-23058). In turn, this causes the following code:

hourScrollSlider.valueChangingProperty().addListener( (observable, oldValue, newValue) ->  {
    if (refreshingAtomicInteger.get() > 0) {
        return;
    }
    acceptChangingCalendar();
});

to never get called and thus, the changingCalendar does not get accepted into the calendarProperty.

There is probably a way to change the code a little bit as to not rely on the valueChangingProperty. This bug can be easily missed by users, as the controls in the popup do reflect the selected time if you open it up again, but anything bound to the calendarProperty is not updated!

tbee commented 9 years ago

Thanks for informing me. I'll take a look!

tbee commented 9 years ago

Fixed it