Using Grails 2.3.9 and Vaadin plugin 7.3.9
class MyUI extends UI {
@Override
protected void init(VaadinRequest vaadinRequest) {
VerticalLayout layout = new VerticalLayout()
layout.setMargin(true)
SignInForm signInForm = new SignInForm()
layout.addComponent(signInForm)
layout.setComponentAlignment(signInForm, Alignment.MIDDLE_CENTER)
layout.setSizeFull()
setContent(layout)
}
}
Custom component
class SignInForm extends CustomComponent {
Panel p = new Panel()
public SignInForm() {
p.setSizeUndefined()
Label label = new Label("test");
p.setContent(label);
setCompositionRoot(p);
}
}
This is how it looks:
How can I center the custom component horizontally?