Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Main window header/footer problem
Hello, I want to know it is possible to create scroll able main window with footer (footer should be all time be on the window bottom, but should not be all time visible).
Panel rootLayout = new Panel(); rootLayout.addStyleName(Runo.PANEL_LIGHT); rootLayout.addStyleName(VB.WHITE); rootLayout.setSizeFull(); rootLayout.setScrollable(true); VerticalLayout content = (VerticalLayout) rootLayout.getContent(); content.setMargin(false); //content.setSizeFull(); VerticalLayout layout = new VerticalLayout(); layout.setSizeFull(); //layout.setSizeUndefined(); VerticalLayout headerLayout = new VBHeaderLayout(); VerticalLayout footerLayout = new VBFooterLayout(); VerticalLayout loginLayout = new LoginLayout(); VerticalLayout contentLayout = new VerticalLayout(); contentLayout.setSizeFull(); contentLayout.addComponent(loginLayout); layout.addComponent(headerLayout); layout.addComponent(contentLayout); layout.addComponent(footerLayout); layout.setComponentAlignment(headerLayout, Alignment.TOP_CENTER); layout.setComponentAlignment(footerLayout, Alignment.BOTTOM_CENTER); rootLayout.addComponent(layout);
Using this code I able only to locate footer layout bottom inside panel content layout, not main window. I found only one opportunity to locate footer on the main window bottom, is set full size for panel content, but if panel content is set size full, this panel will not be longer scroll able. Any suggest how it is possible to do?
add back the content.setSizeFull(); that you have commented away, then change contentLayout into a panel and set size full for that panel. You might also want to do layout.setExpandRatio(contentLayout, 1); to the main part take as much space as possible, and make the header and footer to just so small as they need to be.
You are right, if I will set size full for panel content layout, this will solve my problem, until new component with will be added into panel will be same or less than panel height, if height of new component will be greater, should be shown scroll bar, but this never happen because we set panel layout full size.