Thursday, July 13, 2017

How to detect removed element in GWT

In my application, I have such following code:

public class Application {
    private Element oneElement = null;

    public Application(Document document) {
          oneElement = document.getElementById("org");

    }

    public boolean hasParent() {
          Element parentElement = oneElement.getParentElement();
          return (parentElement != null);
    }
}


In my code, I got oneElement in one constructor. Later, when Application.hasParent() is called, it returns true although this element was removed by running Element.removeFromParent() in another Class. Aparently oneElement is orphan. In GWT, how do I detect orphan elements like oneElement.


Thanks,

David

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment