I am writing one of the first test apps in Vaadin, but I run immediately into some errors.
I created a simple grid to place the components I need but I get a strange error of
GridLayout$OutOfBoundsException
I checked the documentation for the Grids and I think I am having them created the right way, but still a problem.
public class MainView extends CustomComponent {
@AutoGenerated
private AbsoluteLayout mainLayout;
@AutoGenerated
private GridLayout mainGrid;
@AutoGenerated
private GridLayout gridFooter;
@AutoGenerated
private GridLayout gridCenter;
@AutoGenerated
private GridLayout gridHeader;
/**
* The constructor should first build the main layout, set the
* composition root and then do any custom initialization.
*
* The constructor will not be automatically regenerated by the
* visual editor.
*/
public MainView() {
buildMainLayout();
setCompositionRoot(mainLayout);
// TODO add user code here
}
@AutoGenerated
private AbsoluteLayout buildMainLayout() {
// common part: create layout
mainLayout = new AbsoluteLayout();
// top-level component properties
setWidth("100.0%");
setHeight("100.0%");
// mainGrid
mainGrid = buildMainGrid();
mainLayout.addComponent(mainGrid,
"top:1.0px;right:3.0px;bottom:1.0px;left:3.0px;");
return mainLayout;
}
@AutoGenerated
private GridLayout buildMainGrid() {
// common part: create layout
mainGrid = new GridLayout();
mainGrid.setWidth("100.0%");
mainGrid.setHeight("810px");
mainGrid.setImmediate(false);
mainGrid.setMargin(false);
mainGrid.setRows(3);
// gridHeader
gridHeader = new GridLayout();
gridHeader.setWidth("100.0%");
gridHeader.setHeight("140px");
gridHeader.setDescription("Grid Header");
gridHeader.setImmediate(false);
gridHeader.setMargin(false);
mainGrid.addComponent(gridHeader, 0, 0);
// gridCenter
gridCenter = new GridLayout();
gridCenter.setWidth("100.0%");
gridCenter.setHeight("600px");
gridCenter.setDescription("GridCenter");
gridCenter.setImmediate(false);
gridCenter.setMargin(false);
mainGrid.addComponent(gridCenter, 1, 0);
// gridFooter
gridFooter = new GridLayout();
gridFooter.setWidth("100.0%");
gridFooter.setHeight("60px");
gridFooter.setDescription("The Footer");
gridFooter.setImmediate(false);
gridFooter.setMargin(false);
mainGrid.addComponent(gridFooter, 2, 0);
return mainGrid;
}
}
Anyone has an idea why I might be getting outofBound