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.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
CssImport when using Component Exporter by Mikhail Shabarov, 7 months ago
Vaadin8 ColorPicker doesn't have caption in FormLayout
If I add a ColorPicker to a FormLayout, there is no caption in the left column. How can I add one? ColorPicker.setCaption() doesn't help, it only adds displays the caption on the actual color picker button.
ColorPicker color = new ColorPicker();
FormLayout form = new MFormLayout(color);
Last updated on
One ancient API design decision from history that all components have setCaption method, but some components may handle the caption themselves instead of displaying it on the layout - ColorPicker seems to be one of those. You could wrap the picker component in a layout and set the caption for the layout.
CssLayout pickerWrapper = new CssLayout(colorPicker);
pickerWrapper .setCaption("Your caption");
formLayout.addComponent(pickerWrapper );
Last updated on
You cannot reply to this thread.