Howto set required indicator on caption but not on field in FormLayout (Vaa

Greetings,

I use Vaadin 8. I have a FormLayout with some components: RadioButtonGroup, ComboBox and TextField. All fields are required.

By default the RadioButtonGroup has its required indicator (asterisk, *) on its caption. The ComboBox and TextField have their required indicator on the field (see attachment required-indicator-on-fields.png).

How can I change this behaviour so that all components have their required indicator on the caption (see attachment required-indicator-on-caption.png)?

Best regards,
Hennes

34801.png
34802.png

Hi,

Caveat: it’s been a while since I looked into the source code for required indicators (and that was for Vaadin 7). However, unless I remember wrong, you’ll need to use some other Layout if you want to use required indicators to be on Captions. Alternatively, you’ll need to go tweaking client side code for that effect.

Best regards,

Olli

You can probably also tweak CSS to move those indicators.