private void initialize() {
loadPersistenceContext();
List<Events> events = getEventsChoiceBox(getPersistenceContext());
ObservableList<Event> data = FXCollections.observableList(events);
cbEvent.setItems(data); // Inserting data into the ChoiceBox
}
This is my main code. Problem is when the form is loaded, I get the Objects inserted in the ChoiceBox and not the properties.
This is the content of my List Events
Object[]
|- String
|- Integer
Object[]
|- String
|- Integer
So I want a ChoiceBox with that String property showing up and the Integer mapped to my controller.
I tried a lot of things but couldn't figure it out.