Hello,
I’m just trying to build a modal window. I learnt it from this tutorial:
https://examples.javacodegeeks.com/enterprise-java/vaadin/vaadin-window-example/
It looks amazing nice and it works if I import this project to my local workspace.
But if I try to integrate it into my previous project I get pretty weird behaviour… It shows me that methon:
addWindow(modalWindow);
is undefined
Could somebody help me please?
My code:
@PostConstruct
public void init() {
Button bModalWindow = new Button("Modal Window");
bModalWindow.addClickListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
ModalWindow modalWindow = new ModalWindow();
addWindow(modalWindow);
}
});
addComponent(bModalWindow);
Window myWindow = new Window("My Window");
VerticalLayout windowContent = new VerticalLayout();
windowContent.setMargin(true);
myWindow.setContent(windowContent);
myWindow.setWidth("250px");
windowContent.addComponent(new Label("This is a window"));
myWindow.center();
myWindow.addStyleName("mywindowstyle");
addWindow(myWindow);
}