vaadin / board

Framework 8 version of vaadin-board
Other
8 stars 10 forks source link

Component Captions aren't added when adding components #91

Open matwjones opened 7 years ago

matwjones commented 7 years ago

When adding a component to a row with a caption, the caption isn't added and displayed (doesn't seem to appear in the dom either.

To recreate: `board = new Board();

Label l = new Label("Test Label Value"); l.setCaption("Test Label Caption");

Row row = new Row(); row.addComponent(l);

board.addRow(row);`

The components caption is not added along with the component itself. When browsing through the generated html, the caption element doesn't appear to be added at all.

Use Case: When adding components to the board (grids, maps, etc) it would be helpful to be able to caption them.

johannesh2 commented 7 years ago

Thank you. We will consider this for the next minor version.

Peppe commented 7 years ago

Caption is a feature that is available in every Vaadin Component, but it is actually the layouts that decide if they choose to implement it or not. So for example VerticalLayout has code to go through the components, extract the caption from them and create own slots where it puts the captions as text. Board does not implement logic like this in the initial version.

It could be one potential addition to the component. Another, which I'm more considering, would be adding a bundled box to the product, which you could wrap your components in. It would provide caption, borders, a toolbar where you can add buttons, maybe a maximize feature etc.

As a workaround you can add captions by wrapping you component into a layout that supports captions. Like VerticalLayout. So instead of Board -> Row -> Chart hierarchy, you would have Board -> Row -> VerticalLayout -> Chart.