Hi I am new in vaadin but I think that it’s very interesting.
So my Question is about modal calls and i face problems to perform that since the calback function is not in the same class
To explain more, we have the main window of the application that raises many modal sub-windows. In swing there is not a problem cause the tread will stop until the modal window is closed and all the actions performed after the modal window will be executed after the closing of the raised modal window. But in Vaadin it’s not the same concept, the thread continue its work even if the modal window is not closed so all the sequences of the action will be faulted and we have not the same functioning of the application as swing. The problem also is that the modal window can be raised in different stages : For example, there is a java method A that calls another method B in another class and the modal window is launched via the method B. So in swing all the methods A and B will be stopped until the modal window is closed. But in vaadin we face a problem in separating actions performed in the methods A and B since they are not in the same class.
In addition, the modal window is not closed by the “X” button but its closed by removing it from the main window so performing all the actions done after the modal window can’t be done in a “Window.closeListener” and performing all the action in a method launched after the closing of the modal window can’t be done cause some actions are performed in another class.
To help you more to understand what I am talking about I give you this example :
the class A contains the method m1 :
public class A {
public void m1() {
Action 1
Action2 : B b = new B (instance of class B)
Action 3 : (calling m2 in class B : b.m2)
Action 4
Action 5
}
}
public class B {
public void m2() {
Action 1
Action2
Action 3 : (Raises a modal window)
Action 4
Action 5
}
}
In this example, the modal window is raised by the method m2 in the class B but the method m1 in class A calls the method m2. In swing, Action 4, Action 5 in class A and Action 4, Action 5 in class B will not be run until the modal window is closed. But in Vaadin if I act like this :
public class B {
public void m2() {
Action 1
Action2
Action 3 : (Raises a modal window)
modalwindow.addListener(new Window.closeListener() {
B.Action 4
B.Action 5
});
}
}
The actions (Action 4 and Action 5) in the class A will be executed after the modal window is shown and it’s not possible to do them in the close listener cause the actions are not accessible from an another class (class B for example)
Is there any idea???