Question : When you set a Layouts visibility it is either added to the DOM tree or removed from it. What does vaadin do with the removed part? Does it cach it or is it re-created once you set the visibility to show once again? And if its re-created does all its sub-components get re-attached as well?
The reason I ask is that when I hade a VerticalLayout with a form in it and the form it self hade use the below code i couldnt see my textfields that hade the size set to 100% when I went from layout.setVisible(true) -> false -> and show once again.
private Form getAttachedForm() {
return new Form(){
private static final long serialVersionUID = 1L;
@Override
protected void attachField(Object propertyId, Field field){
if(field instanceof TextField){
TextField tf = (TextField)field;
tf.setWidth("100%");
}else if(field instanceof DateField){
DateField df = (DateField)field;
df.setResolution(DateField.RESOLUTION_DAY);
df.setDateFormat("yyyy-MM-dd");
}
super.attachField(propertyId, field);
}
};
}
Vaadin does not remove the elements from the DOM, but sets the
displayproperty (CSS) of the element(s). However, it seems that the sizing information is also deleted and there might be a bug causing the calculations not to be performed when making the components visible again.A bug report at dev.vaadin.com would be much appreciated.