The subwindow that I create does not close. I've seen some people experienced the same issue and posted the same issue but still I cannot find a solution. I have checked this, and this ,and this,and that and could not find a solution. Here' my code below for corresponding class for the window:
public class CommunicationConfigWindow extends Window
{
private static CommunicationConfigWindow INSTANCE;
private final Accordion catAccordion = new Accordion();
private final VerticalLayout layout = new VerticalLayout();
private final HorizontalLayout toolbar = new HorizontalLayout();
private final Button applyButton = new Button( "Save&Close" );
private final Button cancelButton = new Button( "Cancel" );
private CommunicationConfigWindow( )
{
this.toolbar.setDefaultComponentAlignment( Alignment.MIDDLE_CENTER );
this.applyButton.setSizeFull();
this.cancelButton.addClickListener( e -> {
UI.getCurrent().removeWindow( this );
this.close();
} );
this.applyButton.addStyleName( ValoTheme.BUTTON_FRIENDLY );
this.cancelButton.addStyleName( ValoTheme.BUTTON_DANGER );
this.cancelButton.setSizeFull();
this.toolbar.addComponents( this.cancelButton, this.applyButton );
this.toolbar.setSizeFull();
this.catAccordion.addTab( new GeneralCatLayer( CatVersionEnum.CAT21 ), "CAT 21" );
this.catAccordion.addTab( new GeneralCatLayer( CatVersionEnum.CAT23 ), "CAT 23" );
this.catAccordion.addTab( new GeneralCatLayer( CatVersionEnum.CAT247 ), "CAT 247" );
this.layout.addComponents( this.catAccordion, this.toolbar );
this.setContent( this.layout );
}
public static CommunicationConfigWindow getINSTANCE()
{
if ( CommunicationConfigWindow.INSTANCE == null )
{
CommunicationConfigWindow.INSTANCE = new CommunicationConfigWindow();
}
return CommunicationConfigWindow.INSTANCE;
}
}
This is before I click on cancel. This is after I click on cancel.
I do pop-up this window
from a Display Settings Button
. What happens is that:
I basically want the window to be gone when I click on cancel or the close button but it simply does not.Why?
Thanks in advance.
I have not changed anything, after 2 hours spending on this, it started working eventhough I did not change a thing and I have no idea why.