Caption in HorizontalSplitPanel


I’m wondering why the captions of the children in a HorizontalSplitPanel are not shown? I tried the following in Vaadin 7.3, but I couldn’t get it working

HorizontalSplitPanel splitPanel = new HorizontalSplitPanel();
Component testLayout = new VerticalLayout(new Label("testLabel"));

Is this the intended behaviour? I couldn’t find any documentation regarding this. If so, what’s the workaround?

Showing the caption is (for most components except e.g. Button) up to the containing layout. If I remember correctly, SplitPanels do not show the captions of the components inside them.

A quick workaround would be to wrap the contained components in a simple layout (perhaps CssLayout). This could easily be done by a subclass of SplitPanel that checks whether the component being added to it has a caption and wraps it if necessary.


If I remember correctly, SplitPanel does not manage general component captions, icons or error indicators. As a solution, put the caption to the component contained inside the VerticalLayout.

Thanks to both for your help. Maybe it’s worth to mention it somewhere in the documentation, but don’t know where it would fit best.