This probably will sound silly, but I was looking for an answer here and I found it in a thread with a misleading title.
HTMLFlow in Window issues
I have code like this
Inside the window I have a button which "closes" it, since I'm creating a new Window instance every time, I call destroy to close and dispose it (besides, there's no close method).
Notice the final variable "This" to access Window methods from ClickHandler anonymous class. As a final note, if you reuse the window instance (aka don't create it on button clicks), just hide it. This is the default behavior for the "X" button on title bar.
HTMLFlow in Window issues
I have code like this
Code:
IButton btnAgregar=new IButton("Agregar"); btnAgregar.addClickHandler(new ClickHandler(){ @Override public void onClick(ClickEvent event) { Window frmDetalle=new Window(); frmDetalle.setTitle("Agregar datos"); frmDetalle.setIsModal(true); frmDetalle.setSize("50%", "50%"); frmDetalle.centerInPage(); frmDetalle.show(); } });
Code:
final Window This=this; IButton btnCancelar=new IButton("Cancelar"); btnCancelar.addClickHandler(new ClickHandler(){ @Override public void onClick(ClickEvent event) { This.destroy(); } });
Comment