Convert mulitple values to One DataSource.

Hi,
I searched the forum but haven’t found an answer to my problem yet. I’m currently developing an application where the User can enter his Data in a Form with Vaadin 6.8.
I’m using BeanItem and Form.setItemDataSource() to do the data binding like below:

[code]
BeanItem lAccountItem = new BeanItem(pUserAccount);
lAccountItem.addItemProperty(“firstName”, new NestedMethodProperty(lAccountItem.getBean(),
“person.firstName”));

[/code]The Fields are created with a FormFactory:

public Field createField( Item pItem, Object pPropertyId, Component pUiContext ) {
    Field lField;

 
if (ItemProperties.ITEM_BIRTHDAY.equals(pPropertyId)) {
      day = this.getDay(); // returns a combobox for the days
      return day;
    }
eturn birthDayField;
    }
    else {
      // Use the super class to create a suitable field base on the
      // property type.
      lField = super.createField(pItem, pPropertyId, pUiContext);
    }

    if (ItemProperties.ITEM_FIRST_NAME.equals(pPropertyId)) {
      firstName = (TextField) lField;
      return firstName;
    }
    return lField;
  }

Now I like to add the Birthdate to the form. The date will be selected with a ComboBox for day, month and year.
Is it somehow possible to convert these three values to a java.util.Date value and bind this with the

NestedMethodProperty(lAccountItem.getBean(),
        "person.birthday")); 

Which requires a java.util.Date Object so the values of the Comboboxes will be set to the right values on start up and are written to the POJO when I commit the Form?

Thanks in advance,
Miriam

You should use a CustomField for this, or a suitable add-on such as
DateSelector
.

Note that the add-on was developed for a beta version of Vaadin 7 - you should check that it still works with the latest release and contact the author (e.g. by filing a ticket in the issue tracker of DateSelector, see link on the Directory page) if not.