Required-star not shown in Combobox inside FieldGroup

Hi,
in my code I have a FieldGroup that is bound to BeanItem:

BeanItem<User> item = new BeanItem<User>(myUser);     
FieldGroup userGroup = new FieldGroup(item);

inside the fieldGroup I have a ComboBox that is bound to the property “role” of User:

ComboBox cmbRole = userGroup.buildAndBind("Ruolo", "role", ComboBox.class);
cmbRole.setFilteringMode(FilteringMode.STARTSWITH);
cmbRole.setImmediate(true);
cmbRole.setNullSelectionAllowed(false);
cmbRole.setSizeFull();
cmbRole.setRequired(true);

My userGroup is initially readOnly = true, but when I click the button “Edit form” I set readOnly property to false and all my fields become editable.

The issue is that no required-star (*) is visible near the cmbRole, even if now is not readOnly.

Other fields, such as TextField, TextArea etc. behave normally, and required-star is visibile when fieldGroup is set to readonly = false.

Can somone help me?

Best regards,
Carlotta M.

The required property seems to work fine at http://demo.vaadin.com/sampler/#ui/data-input/multiple-value/combo-box . What layout are you using?

Hi,
thank you for your reply.

I’m using FormLayout.
At the beginning my form should not be editable (I only want to show the content of fields, that are bound to some properties of my User), so I set the readonly property of my fieldGroup = true. In this case no red-star is visible near the combobox.

I know that, if the fieldgroup is readonly, it is normal the red-stars are not shown near fields, but I expect that, when I change the readonly property, red stars become visible.
It seams like the fieldGroup does not totally refresh, and the combo “think” that its parent is still readonly.

Based on a quick search, there seem to be tickets about this already (
#11631 for ComboBox and DateField
,
#11695 for Tree
). At least the first one only applies to layouts other than VerticalLayout and HorizontalLayout according to the ticket.