Issue
I have two comboBox example comboBox a and b. I want to disable comboBox b when comboBox an is null and when selected specific value from comboBox a.
comboboxb.disableProperty().bind(
JavaFxObserver.toBinding(
JavaFxObservable.nullableValuesOf(comboboxa.getSelectionModel().selectedItemProperty())
.map(test -> !comboboxaEnum.isPresent() || comboboxaEnum.equals(comboboxaEnum.XX) ))
);
It is only disable when comboBox is null.
Solution
I managed to disable the combobox using Easybind
comboboxb.disableProperty()
.bind(EasyBind.map(comboboxa.getSelectionModel().selectedItemProperty(),
comboboxaEnum ->
comboBoxAEnum == comboBoxAEnum.XX || comboBoxAEnum == null));
Answered By - syafiqah
Answer Checked By - Gilberto Lyons (JavaFixing Admin)