The size of
Calendar component
in subwindow doesn’t
expand
or
shrink
to fit the size of subwindow when i click on
maximize
or
minimize
button in subwindow.
So i have to click on random button or combobox for vaadin calendar component to fit perfectly in subwindow.
Here are
pictures
that show my problem
(pictures can be view on stackoverflow, here is the link):
http://stackoverflow.com/questions/37052108/expanding-or-shrinking-size-of-vaadin-calendar-component-in-subwindow
Code for opening a subWindow:
[code]
Window abonWindow = new Window(“Abonma”);
abonWindow.setImmediate(true);
abonWindow.setHeight(“450px”);
abonWindow.setWidth(“700px”);
abonWindow.setModal(true);
abonWindow.setContent(new AddAbonma(abonWindow));
UI.getCurrent().addWindow(abonWindow);
[/code]
I add all compontents in subwindow with this code:
mainLayout = new AbsoluteLayout();
mainLayout.setImmediate(true);
mainLayout.setWidth("100%");
mainLayout.setHeight("100%");
setWidth("100.0%");
setHeight("100.0%");
initCalendar();
initLayoutContent();
initSettingPopupview();
panel_criteria = buildPanel_criteria();
mainLayout.addComponent(panel_criteria, "right:0.0px;top:0.0px;left:0.0px;");
mainLayout.addComponent(calendarComponent, "right:0.0px;top:70.5px;bottom:0px;left:0.0px;");
initCalendar code:
calendarComponent.setLocale(new Locale("sl","SL"));
calendarComponent.setImmediate(true);
calendarComponent.setHeight("100%");
calendarComponent.setWidth("100%");
This is all code that i have in constructor of SubWindow, i put also addWindowModeChangeListener
in it:
buildMainLayout();
setCompositionRoot(mainLayout);
initGui(window);
window.addWindowModeChangeListener(new WindowModeChangeListener() {
@Override
public void windowModeChanged(WindowModeChangeEvent event) {
System.out.println("AddAbonma WindowMode");
if(calendarComponent!=null){
calendarComponent.markAsDirtyRecursive();
}
}
});
This approach worked with tables, but does not work with vaadin calendar component.
So how do i expand or shrink vaadin calendar component to fit the
subwindow
when user click on maximize or minimize button?