Project

General

Profile

« Previous | Next » 

Revision 55f3f727

Added by Andreas Kohlbecker over 6 years ago

fix #6843 avoiding oversized windows by setting a defined height

View differences:

src/main/java/eu/etaxonomy/vaadin/mvp/AbstractCdmPopupEditor.java
48 48
     */
49 49
    public AbstractCdmPopupEditor(Layout layout, Class<DTO> dtoType) {
50 50
        super(layout, dtoType);
51
        // IMPORTANT: the layout must be set to full size otherwise the
52
        // popup window may have problems with automatic resizing of its
53
        // content.
54
        layout.setSizeFull();
55 51
        if(MarginHandler.class.isAssignableFrom(getFieldLayout().getClass())){
56 52
            ((MarginHandler)getFieldLayout()).setMargin(new MarginInfo(false, true, true, true));
57 53
        }
src/main/java/eu/etaxonomy/vaadin/mvp/AbstractPopupEditor.java
87 87

  
88 88
    public AbstractPopupEditor(Layout layout, Class<DTO> dtoType) {
89 89

  
90
        setWidthUndefined();
91

  
92 90
        mainLayout = new VerticalLayout();
93 91
        // IMPORTANT: mainLayout must be set to full size otherwise the
94 92
        // popup window may have problems with automatic resizing of its
95 93
        // content.
96 94
        mainLayout.setSizeFull();
95
        setCompositionRoot(mainLayout);
97 96

  
98 97
        fieldGroup = new BeanFieldGroup<>(dtoType);
99 98
        fieldGroup.addCommitHandler(new SaveHandler());
100 99

  
101
        setCompositionRoot(mainLayout);
102

  
103 100
        toolBar.addStyleName(ValoTheme.WINDOW_TOP_TOOLBAR);
104 101
        toolBar.setWidth(100, Unit.PERCENTAGE);
105 102
        toolBarButtonGroup.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
src/main/java/eu/etaxonomy/vaadin/ui/navigation/NavigationManagerBean.java
130 130
		window.setModal(true);
131 131
		window.setCaptionAsHtml(popupView.isWindowCaptionAsHtml());
132 132
		window.setWidth(popupView.getWindowPixelWidth(), Unit.PIXELS);
133
		// setting 100% as default height. If the height
134
		// would be undefined the window, will fit the size of
135
		// the content and will sometimes exceed the height of the
136
		// main window and will not get a scroll bar in this situation.
137
		// see #6843
138
		window.setHeight("100%");
133 139
		window.setContent(popupView.asComponent());
134 140
		// window.addCloseListener(e -> popupView.cancel());
135 141
		UI.getCurrent().addWindow(window);

Also available in: Unified diff