2014-04-10 69 views
1

怎么能够使用布局组件(新vaadin)滚动vaadin视图来显示所有的组件在页面

眼下无论组件我在UI组件添加vaadin实现Html网页中只有一些组件出现在浏览器...

没有滚动选项来查看我在层次

public class LoginView extends CustomComponent implements View, 
    Button.ClickListener { 

    public static final String NAME = "login"; 

    private TextField user; 

    private PasswordField password; 

    private Button loginButton; 
    NativeSelect select_role; 

    private HorizontalLayout fieldsBottomPanel; 

    private VerticalLayout fieldsLeftPanel; 

    private GridLayout loginPanelGrid; 

    private VerticalLayout filedsTopPanel; 

    private VerticalLayout loginFormLayout; 

    private Label top_header_panel; 

    private VerticalLayout virtualKeyboard; 

    private VerticalLayout fieldsRightPanel; 

    private VerticalLayout footer; 

    private VerticalLayout header; 

    private Window page; 



    public LoginView() { 
     setSizeFull(); 
     addTopPanelToLoginForm(); 
     addLeftPanelToLoginForm(); 
     addBottomPanelToLoginForm(); 
     addRightPanelToLoginForm(); 
     addLoginFormToPage(); 
     addFooterToPage(); 
     addHeaderToPage(); 

     VerticalLayout viewLayout = new VerticalLayout(header,loginFormLayout,footer); 
     viewLayout.setComponentAlignment(loginFormLayout, 
       Alignment.MIDDLE_CENTER); 
     viewLayout.setStyleName(Reindeer.LAYOUT_WHITE); 

     setCompositionRoot(viewLayout); 
    } 

    public void addHeaderToPage(){ 
     header = new VerticalLayout(); 
     header.setStyleName("header-login"); 
    } 


    public void addFooterToPage(){ 
     footer = new VerticalLayout(); 
     footer.addStyleName("footer-login"); 
    } 
} 
+0

你可以分享的任何截图或代码块? – PopoFibo

+0

我需要网站像默认滚动,当有更多的内容可用... – aps109

回答

4

你必须把你的内容变成一个小组,因为布局不提供滚动条下方添加其他组件。

[...]如果[面板]有一个固定或百分比计算的规模和它的内容变得太大,不适合在内容区域,一个滚动条会出现在特定的方向。 [...]

从Vaadin书章6.6.1

看一看这个线程here

相关问题