Closed warmuuh closed 2 years ago
My bad, I should delete that method and make the property read only.
You are doing it the wrong way. To select an item you must use the selection model.
So: nmfx.getSelectionModel().selectItem("b");
ok, that works... just mentioning: also nmfx.getSelectionModel().setSelectedItem(...)
doesnt work, could maybe a bit streamlined.
one follow-up question would be what property to use for property-binding? for all other combo-boxes, it was the value
-property.
normally, i use something like comboBox.valueProperty().bindBidirectional(otherProperty)
Almost done :)
Fixes available on staging branch, I think I'll make some more improvement though
MFXComboBoxes have been reworked in latest release Many improvements to selection, and values set have been made
Using combobox, something is off with setting the selectedValue, example code:
this results in an empty combo-box being rendered (as in: no value selected). using
Platform.runLater(() -> nmfx.setSelectedValue("b"));
instead, the value is now there but the value is not highlighted as selected in the list-view:once manually selecting a value, the value and selected item in list are in sync
one more difference to other comboboxes (MFXLegacyComboBox, ComboBox or JFXComboBox) is that dropdown doesnt close once window looses focus, but that might be not an issue at all