Search code examples
gwtgwt-bootstrap

How to destroy a GWT Bootstrap Modal when it is closed


I have some data that is displayed in a CellTable, one of the columns is a clickable. On clicking that column I display the data associated with it in another CellTable inside of a Modal.

I have set up a UIBinder element for this.

In the FieldUpdater I create a new instance of the UIBinder element, after it is closed I want it to be destroyed or removed from the DOM. This element has a GWT Bootstrap Modal

What happens now is that it gets hidden and when I click the new instance is created. I think this will be a problem when the size of the data increases and on prolonged use of the application.

I'd like to know how I can either reopen the existing element or destroy the element once it is closed. I couldn't find any event like onClose


Solution

  • Doesn't "setDynamicSafe" do exactly what you want?

    Setup the modal to prevent memory leaks. When modal is hidden, will remove all event Handlers, and them remove the modal DOM from document DOM. Default is false.

    Parameters: dynamicSafe