Hi,
I just tried to use your code for DateTimePicker and I found a bug.
When you user modifies value in textfield, DateValue doesn't get updated. This is not happening when user confirms his changes with Enter.
Your code has listener on focusedProperty so I though it should be working even without Enter press.
After some time of debugging I found that simulatedEnterPressed() is calling getEditor.commitValue(). I tried to change that to fireEvent to press Enter but with no success. So I went deeper into commitValue() -> that is depending on Textformatter which is NULL. When formatter is null, it cant update the value.
I fixed everything with new line of code in DateTimePicker constructor:
getEditor().setTextFormatter(new TextFormatter<>(getConverter()));
After this line everything works.
I hope it helps someone. Maybe problem is just with JavaFX version (I'm using openJFX 15.0.1 )
Hi, I just tried to use your code for DateTimePicker and I found a bug. When you user modifies value in textfield, DateValue doesn't get updated. This is not happening when user confirms his changes with Enter. Your code has listener on focusedProperty so I though it should be working even without Enter press.
After some time of debugging I found that simulatedEnterPressed() is calling getEditor.commitValue(). I tried to change that to fireEvent to press Enter but with no success. So I went deeper into commitValue() -> that is depending on Textformatter which is NULL. When formatter is null, it cant update the value.
I fixed everything with new line of code in DateTimePicker constructor:
getEditor().setTextFormatter(new TextFormatter<>(getConverter()));
After this line everything works. I hope it helps someone. Maybe problem is just with JavaFX version (I'm using openJFX 15.0.1 )