Hello,
I have a problem in vaadin 7 using simple VerticalLayouts and HorizontalLayout with fixed size but it generates div with class v-slot and a relative width of 50%
I try to do a little poc with Vaadin7 Beta2 with a standard layout wich is composed by :
- a main view which is a vertical layout that contains one header and one main layout with a fixed layout of 1000px.
- the main layout is a horizontal layout composed of one left layout with a fixed width of 200px and a content layout with a fixed width of 800px.
Here is the code of the main view :
public class MainView extends VerticalLayout implements View {
/**
*
*/
private static final long serialVersionUID = 1L;
// private VerticalLayout mainLayout;
private HorizontalLayout headerLayout;
private HorizontalLayout centerLayout;
public MainView() {
buildMainLayout();
setMainContent();
}
private void buildMainLayout() {
// the main layout and components will be created here
setSizeFull();
setMargin(false);
setSpacing(false);
headerLayout = new HorizontalLayout();
headerLayout.setHeight("85px");
headerLayout.setWidth("100%");
headerLayout.setStyleName("debug-green");
HeaderView headerView = new HeaderView();
headerView.setWidth("1000px");
headerLayout.addComponent(headerView);
headerLayout.setComponentAlignment(headerView, Alignment.TOP_CENTER);
centerLayout = new HorizontalLayout();
centerLayout.setWidth("1000px");
centerLayout.setHeight("100%");
centerLayout.setSpacing(false);
centerLayout.setMargin(false);
addComponent(headerLayout);
addComponent(centerLayout);
setComponentAlignment(centerLayout, Alignment.TOP_CENTER);
}
public void setMainContent() {
// centerLayout.removeAllComponents();
centerLayout.addComponent(new FiltersView());
centerLayout.addComponent(new ContentView());
}
And here is the FiltersView class :
public class FiltersView extends VerticalLayout {
/**
*
*/
private static final long serialVersionUID = 1L;
public FiltersView() {
setWidth("200px");
setHeight("600px");
setStyleName("debug-red");
buildLayout();
}
private void buildLayout() {
this.addComponent(new Label("Account filters here"));
}
}
and the content view :
public class ContentView extends VerticalLayout {
/**
*
*/
private static final long serialVersionUID = 1L;
public ContentView() {
setWidth("800px");
setHeight("100%");
setStyleName("debug-blue");
buildLayout();
}
private void buildLayout() {
this.addComponent(new Label("Main content here"));
}
}
and it gives me two blocks of 50% each instead of 200px and 800px.
Any suggestion on what I’m doing wrong?
Thanks