Copy ComboBox to another ComboBox

I have populated a ComboBox from a DB query. It all populates and displays as expected. I display this on a form and can bind it. I need the same ComboBox on another form too, but i don’t want to go a fetch the contents from the DB again. I need a way whereby i can create a new ComboBox and assign the old to it, BUT have the ability to set some differences on the second (different Caption etc). How can i clone the ComboBoxes at run time so they are distinct after being populated (and not copied by reference)?

Note, i have tried combo2.setContainerDataSource(combo1.getContainerDataSource()) without success as the display values aren’t maintained…

I think it is just enough to save in a list the items of the combobox and them set item of both comboboxes using the same list.

 List<String> letters = Arrays.asList("a","b","c");
 ComboBox<String> c1 = new ComboBox<>("ComboBox1",letters);
 ComboBox<String> c2 = new ComboBox<>("ComboBox2",letters);

You can also set the data prodiver of one combobox into the other one.

 List<String> letters = Arrays.asList("a","b","c");

 ComboBox<String> c1 = new ComboBox<>("ComboBox1",letters);
 DataProvider<String, ?> dataProvider = c1.getDataProvider();

 ComboBox<String>  c2 = new ComboBox<>("ComboBox2");
 c2.setDataProvider(dataProvider);