Set item captions for datasource in ComboBox

Hi I am using a container to populate a combo box with two values. I want one of the values to be the item caption, and the other value is the PK of the database field. How do I set the display value or caption of these items? The reason I want to do this is because I will have a combobox in a bunch of table rows, and it would be more efficient to use the data source,(or copy the combo box somehow?)

Container customFieldDataSource = new IndexedContainer();
        customFieldDataSource.addContainerProperty("fieldname", String.class, null);
        customFieldDataSource.addContainerProperty("fieldPK", Integer.class, 0);
        for(Object loopobj : customFieldList)
            Field customField = (Field) loopobj;
            Object itemId = customFieldDataSource.addItem(); //add an item to the container, and set it to itemId
            Item item = customFieldDataSource.getItem(itemId);

From a search I’m guessing it’s something like this isn’t it:

combobox.setItemCaptionPropertyId("name"); // the person's name field will be shown on the UI

Yup it seems to have worked. Apparently the first line is deprecated, and I guess not needed.

I added: