I've created a dedicated editor for an XML file. Different panels in this editor contain specialized editors for sections of the XML file. Some of these panels are bound to DomElements that are part of an XML collection. These panels extend BasicDomElementComponent.
The problem is that when I delete or add a tag in that section the underlying DomElement of the panel becomes invalid. I can see a CollectionElementRemovedEvent and a CollectionElementAddedEvent that indicate that the DomElement that was bound to the panel is removed, and a new one is attached to the containing collection element.
How do I handle the fact that the DomElement underlying my panel becomes invalid? How do I attach the panel to the new DomElement?