Select(ComboBox) Data Mapping

Hello, Vaadiners!


TASK

There is a document object that has 10 fields. Each field has 6 properties. I need to show these fileds in a table.
There is a Field class:


public class Field {
	private String name;
	private String description;
	private FiledTypeInfo type;
    
        // getters / setters 
}

As you can see, there is a field property called “type”, which is an instance of one of these classes:

  • DateFieldType
  • BooleanFieldType
  • IntegerFieldType
  • SpecialFieldType
    which imlement the FieldTypeInfo interface.

When a user hits an “edit” button (which triggers the table to get to the edit mode), the “type” column (the cell of the concrete row) of the table must give a chance to choose the type from the select. According to system requirements (too complex to explain) I’ve created a wrapper on the FIeldTypeInfo that has two properties: caption and value, and to create a select in a cell of the table I use a custom TableFieldFactory.

I use a BeanItemContainer with my table.


PROBLEM

Where should I perform data mapping between the select’s item (FIeldTypeInfo wrapper) and the BeanItemContainer’s item field (Field.type) when a user selects some value?

If it is possible, please, give a link to read about or post a snippet.