Hello everyone,
I’m trying to set to some captions for various layouts - horizontal and vertical. I’ve already checked the demo and every single layout have a caption. I’ve made a simple app to try the caption, but the caption is never show in browser. I’ve also checked with “inspect elements” the generated html/css code and notice that I’m missing “v-has-caption” style. Here is the code, can someone redirect me to somewhere where to read how the caption must be set or to explain why my caption is missing and how to make it work!
@Theme("mytheme")
public class MyUI extends UI {
@Override
protected void init(VaadinRequest vaadinRequest) {
final VerticalLayout layout = new VerticalLayout();
layout.setCaption("LAYOUT CAPTION TEST");
final TextField name = new TextField();
name.setCaption("Type your name here:");
name.setWidth("234");
name.setHeight("31");
Button button = new Button("Click Me");
layout.addComponents(name, button);
layout.setSizeFull();
layout.setComponentAlignment(name, Alignment.MIDDLE_RIGHT);
setContent(layout);
}
@WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = MyUI.class, productionMode = false)
public static class MyUIServlet extends VaadinServlet {
}
}