Strange behavior of ComboBox in Form


I’m using ComboBox in a Form which takes BeanItem as ItemDataSource. My FormFieldFactorys relevant part looks like this:

if(propertyId.equals("projectManager")) {
			this.managerSelect = new ComboBox("Manager");
			for(User u : managers) {
				managerSelect.setItemCaption(u, u.getName());
			return managerSelect;

Now my problem is that if I set forms readOnly to true (like it is not editable, really just read only) and then press edit (only change its footer and set readOnly to false), then press cancel (changes readOnly to true) and repreat this, then everytime I press edit so my form becames editable, the width of the ComboBox grows something like 5mm.

And this happens every time!! What am I doing wrong?

Here’s also my setProjectEditable method which is called with parameter true when I click edit and with false when I click cancel.

public void setProjectEditable(boolean editable) {

Thanks for any help!!

This sounds like a bug, but I could not reproduce it with simply setting a combo box as read only and back.

Which Vaadin version are you using?
What is the size of the form and its layout? In what kind of a layout is it?

You could also check that all your layouts in that view are valid using the ?debug parameter in the application url and then clicking “Analyze layouts”.

If your layouts are valid, a small program that demonstrates the issue would be very helpful. You could also create a new
about the issue.

Thanks for your answer Henri!!

I made a dummy test project to illustrate the problem. By repeatedly pressing Edit and Cancel (which in fact do the opposite of what they should do) the width of ComboBox grows all the time.

I didn’t create a ticket about it yet because I guess that it might as well be my mistake on something. -_- (3.57 MB)

Your example had an invalid layout (check “Analyze layouts” with the URL parameter ?debug), but that was not behind the problem.

There seems to be a bug in Vaadin - created
ticket 5833
with a reduced test case.