Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Table with DateField cell makes size calculation wrong
Hello,
I have a little problem. I have a table that I fill with some data.
In the first screenshot (table_ok.png), everything works well, I can see 2 buttons at the bottom, and table.setSizeFull() works well.
When I add this code to make first and second cells to use DateField component :
table.setTableFieldFactory(new DefaultFieldFactory()
{
private static final long serialVersionUID = 1L;
/**
* (non-Javadoc)
*
* @see com.vaadin.ui.DefaultFieldFactory#createField(com.vaadin.data.Container, java.lang.Object,
* java.lang.Object, com.vaadin.ui.Component)
*/
@Override
public Field createField(Container container, Object itemId, Object propertyId, Component uiContext)
{
if(propertyId.equals("debut") || propertyId.equals("fin"))
{
return new DateField();
}
else
{
return super.createField(container, itemId, propertyId, uiContext);
}
}
});
Now, table is unable to compute the full size, it makes the 2 buttons to disapear, and row height are strange. (second screenshot : table_error.png)
What can I do to make it works well ?
Thanks.
Ok, I manage to find a workaround.
I have added these CSS modification in a custom theme :
.v-table-cell-wrapper .v-textfield {
min-height: 19px;
}
.v-table-cell-wrapper .v-datefield-textfield {
max-width: 105px;
}
And I change the setSizeFull() call on my table with this :
table.setWidth("640px");
table.setHeight("339px");
It is not really ideal, but it works so far.