Hi, my name is Alessandro.
My problem is that I can not hit the FormLayout in the page.
Now, I’m using Eclipse and Apache Tomcat 6 (and, of course, Vaadin 7).
When I started the program, the FormLayout appear in Top left of the page, and not in middle center.
This is my source code.
Sorry for my English.
Alessandro
public class LoginForm extends Panel implements View{
public LoginForm() throws MethodException{
super("Inserire le credenziali di accesso:");
setSizeUndefined();
VerticalLayout vLayout = new VerticalLayout();
final FormLayout layout = new FormLayout();
layout.setMargin(true);
final TextField nameField = new TextField("Username:");
nameField.focus();
layout.addComponent(nameField);
...
setContent(layout);
vLayout.addComponent(layout);
vLayout.setComponentAlignment(layout, Alignment.MIDDLE_CENTER);
setContent(vLayout);
}
...
Thank you for the answer!
I’ve tried, but don’t work. FormLayout appear in Top-left of page.
The source code now is:
public class LoginForm extends Panel implements View{
public LoginForm() throws MethodException{
super("Inserire le credenziali di accesso:");
setSizeUndefined();
VerticalLayout vLayout = new VerticalLayout();
vLayout.setSizeFull();
final FormLayout layout = new FormLayout();
layout.setMargin(true);
final TextField nameField = new TextField("Username:");
nameField.focus();
layout.addComponent(nameField);
...
setContent(layout);
vLayout.addComponent(layout);
vLayout.setComponentAlignment(layout, Alignment.MIDDLE_CENTER);
setContent(vLayout);
}
...
Don’t work.
I try to explain the situation. In a class, named InterfaceadatabaseUI, I have the init() method. In this class, initialize a navigator to manage the pages.
Navigator navigator = new Navigator(this,this);
//creo e registro le view
navigator.addView(LoginForm.VIEW_NAME, new LoginForm());
navigator.addView(MainView.MAINVIEW, MainView.class);
navigator.navigateTo(LoginForm.VIEW_NAME);