This bug happens very seldom.
Basically, sometimes it doesn't display the items.
Please check the attachment before reading the steps. You will see a ChoiceBox displayed very strange.
Steps:
1.
// This ChoiceBox is called Mål in the screenshot. It belongs to left tab "Del B" from parent tab "Forløb".
@FXML private ChoiceBox<ProgressGoal> goalCB;
goalCB.setItems(new ObservableListWrapper<>(myList));
ProgressGoal entity class content summary:
private Integer id;
private Progress progress;
private Progress.Category category;
private String name;
// Getters and setters
@Override
public String toString() {
return name;
}
2.
I do modify some data in left tab "Målene", then I run the following code to update the items from my ChoiceBox:
int previousSelectedIndex = goalCB.getSelectionModel().getSelectedIndex();
// Creates an empty list to trigger the change
goalCB.setItems(new ObservableListWrapper<>(new LinkedList<ProgressGoal>()));
goalCB.setItems(new ObservableListWrapper<>(cepc.getProgress().getGoals()));
// Clears before to trigger the change
goalCB.getSelectionModel().clearSelection();
goalCB.getSelectionModel().select(previousSelectedIndex);
3.
After that, but very seldom, the items don't appear when I click the ChoiceBox.
It looks like in the screenshot. It appears a very small thing.
If I put the mouse over that small little circle (or whatever), then the items are displayed.
I hope this can help to identify the bug.
I will upload the screenshot in a comment, because the "Create issue" pop-up doesn't allow this feature.
Basically, sometimes it doesn't display the items.
Please check the attachment before reading the steps. You will see a ChoiceBox displayed very strange.
Steps:
1.
// This ChoiceBox is called Mål in the screenshot. It belongs to left tab "Del B" from parent tab "Forløb".
@FXML private ChoiceBox<ProgressGoal> goalCB;
goalCB.setItems(new ObservableListWrapper<>(myList));
ProgressGoal entity class content summary:
private Integer id;
private Progress progress;
private Progress.Category category;
private String name;
// Getters and setters
@Override
public String toString() {
return name;
}
2.
I do modify some data in left tab "Målene", then I run the following code to update the items from my ChoiceBox:
int previousSelectedIndex = goalCB.getSelectionModel().getSelectedIndex();
// Creates an empty list to trigger the change
goalCB.setItems(new ObservableListWrapper<>(new LinkedList<ProgressGoal>()));
goalCB.setItems(new ObservableListWrapper<>(cepc.getProgress().getGoals()));
// Clears before to trigger the change
goalCB.getSelectionModel().clearSelection();
goalCB.getSelectionModel().select(previousSelectedIndex);
3.
After that, but very seldom, the items don't appear when I click the ChoiceBox.
It looks like in the screenshot. It appears a very small thing.
If I put the mouse over that small little circle (or whatever), then the items are displayed.
I hope this can help to identify the bug.
I will upload the screenshot in a comment, because the "Create issue" pop-up doesn't allow this feature.