How do I data bind a multiselect OptionGroup of enum constants?

I got a java a enum called Months:


public enum Months implements Internationalizable {
    JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER;

    @Override
    public String getI18nKey() {
        return "month." + name().toLowerCase();        
    }
    
}

and a domain object


public class Subscription {
    private Months[] months;

    public Subscription(Months[] months) {
        this.months = months;
    }

    public setMonths(Months[] months){
        this.months = months;
    }

    getMonths() {
        return months;
    }
}

i want to bind the domain object to a form using a formfieldfactory as a group of checkboxes where you can chose 0 or more months.

So far I got something like this in the form field factory


    @Override
    public Field createField(Item item, Object propertyId, Component uiContext) {
        Field f;
        Property p = item.getItemProperty(propertyId);
        if( p.getType().isArray() ) {
                OptionGroup radio = new OptionGroup();
                Class<?> cls =p.getComponentType();                    
                radio.setContainerDataSource(new IndexedContainer(Arrays
                       .asList(cls.getEnumConstants())));
                radio.setMultiSelect(true);
                radio.setPropertyDataSource(p);
                f = radio;
        } else {
            f = super(item, propertyId, uiContext);
        }
     return f;
    }

But because the optiongroup returns a Collection this doesn’t work. I’ve also tried using a Collection instead of an array in the domain object but then I wasn’t able to get the enum class and it’s constants. Finaly I tried overlaying the collection class with a Interface containg the functions public Class<?> getEnumClass() and public void setEnumClass(Class<?> cls) but didn’t get that right either.

Any Idea on how to get this working?