JavaFX ComboBox OnChangeListener rollback change
I’m trying to reset the selection of a
So, after trying to reset the list to the old value I get this Exception:
As it seems I don’t get the underlying behaviour of
Does anyone have suggestions how I could make this work?
Thanks in advance
Based on your comment what you want is: When the (selected) value of the
For this you can use for example the valueProperty of the ComboBox with a listener. The listener body is just to check for the condition and the value update is nested in a
In the example it is a
… or you can use the selectedItemProperty also with the same structure …
Note: This solution is not to “prevent” the selection, just as in the title: “roll-back” an already performed selection.