Is it possible to add one default checkbox “Select/Unselect All” at the top of all options if the OptionGroup is multi-select options group. This checkbox should not be visible to server, just like a shortcut to click all options at one time.
Currently, I using one extra button to do this job, but sometime the layout looks weird if OptionGroup created with caption.
While I would normally recommend doing such things on the server side, in this particular case, it might be easy to extend the client side VOptionGroup and have your own server side class that only inherits OptionGroup and has the annotation @ClientWidget. On the client side, it might be enough to override the methods buildOptions() and onClick(). You probably also need to duplicate the field optionsToKeys.
Note, though, that the client side API is not fixed and might change between Vaadin versions.
To do this on the server side, you could create a CustomComponent (or a
CustomField
) that implements the functionality with composition and listeners, and puts the caption in the correct place.