OK, been a while, here goes:
I have a non-edittable combobox and 3 radio buttons.
When I select a radio button, I reset the items in the list, and execute :
category.getSelectionModel().clearSelection();
category.setValue(null);
The intent is a new list, nothing preselected, and the prompt showing inthe text(?) box. And it seems to work at first.
However, when I select the original radio button, the first list is restored, and the combo box shows my original selection!
I would like the prompt to be displayed as with the other radio buttons. I can't even find where the originally select value is stored! It LOOKS like the selection is cleared, as is the value, but the renedered control still shows a selection, even though with the previous list it showed the prompt
templateToggle.selectedToggleProperty().addListener(new ChangeListener<Toggle>() {
@Override
public void changed(ObservableValue<? extends Toggle> ov,
Toggle old_toggle, Toggle new_toggle) {
if (templateToggle.getSelectedToggle() != null) {
final String tmplType = ((RadioButton) templateToggle.getSelectedToggle()).getText();
Preferences.userNodeForPackage(Evidentia.class).put(Const.O_TMPL_TYPE,
tmplType);
Platform.runLater(new Runnable() {
@Override
public void run() {
category.getSelectionModel().clearSelection();
category.setValue(null);
category.getEditor().setText(""); << was getting desparate
ListManager.getInstance().setTemplateCategoryList(TemplateDao.getInstance().findCategories(tmplType)); << template list is the list behind the combo
}
});
}
}
});
Thoughts?
Edited by: edward17 on Apr 8, 2013 11:20 AM
Edited by: edward17 on Apr 8, 2013 5:11 PM
Edited by: edward17 on Apr 8, 2013 5:12 PM