Hey,
I want to create a WarningDialog which resets the whole Application. I need something like “getApplication().close()”. However, I’ve created the listener’s function in the
“SubWindow” class
like this:
Button ok = new Button("Yeah!");
ok.addStyleName("danger");
ok.addClickListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
getApplication().close();
}
});
This is how I instanciate the dialog in the parent interface:
deny.addClickListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
WarningDialog dialog = new WarningDialog();
setEnabled(false);
UI.getCurrent().addWindow(dialog);
}
});
If I try to click the supposed ok button I get this error:
java.lang.Error: Unresolved compilation problem:
The method getApplication() is undefined for the type new Button.ClickListener(){}
Can someone help me out how to reset the application from a subwindow (dialog)?
Thanks!