Calendar with container data source and property 'allDay'

When using the calendar component with a container data source, the allDay property does not seem to be interpreted. I was not able to create all-day events using a container data source.

I’m using Vaadin 7.2.4.

I’m using the following code:
public class SensoWebUI extends UI {
@SuppressWarnings(“unchecked”)
@Override
protected void init(final VaadinRequest request) {
final IndexedContainer indexedContainer = new IndexedContainer();
indexedContainer.addContainerProperty(ContainerEventProvider.STARTDATE_PROPERTY, Date.class, null);
indexedContainer.addContainerProperty(ContainerEventProvider.ENDDATE_PROPERTY, Date.class, null);
indexedContainer.addContainerProperty(ContainerEventProvider.CAPTION_PROPERTY, String.class, null);
// Constant is missing, but “all-day” does not work either
indexedContainer.addContainerProperty(“allDay”, Boolean.class, null);

    final Item item = indexedContainer.getItem(indexedContainer.addItem());
    item.getItemProperty(ContainerEventProvider.STARTDATE_PROPERTY).setValue(new Date());
    item.getItemProperty(ContainerEventProvider.ENDDATE_PROPERTY).setValue(new Date());
    item.getItemProperty(ContainerEventProvider.CAPTION_PROPERTY).setValue("Test");
    item.getItemProperty("allDay").setValue(true);

    final Calendar calendar = new Calendar();
    calendar.setContainerDataSource(indexedContainer);
    calendar.setSizeFull();
    setContent(calendar);
}

}

all-day events do work when using an EventProvider instead of a container. This is my current workaround.
Can you reproduce this behaviour?

Hi, it looks like the allDay property is a missing feature. It’s probably just been forgotten for some odd reason. I added ticket
#14178
about this. It might get fixed when the Calendar is revised next.

Meanwhile, I suggest extending ContainerEventProvider and implementing the feature, it’s not terribly difficult. You probably just need to reimplement at least getEvent() and addEvent(). In getEvent(), you can probably just call super.getEvent() and then copy the property value to the event. In addEvent(), you probably need to copy the source code of the method to add the property. And of course you need the setter and getter for the property ID of the allDay property if you need to set it as something different.

Thanks. Your proposed work-around works for me.