Is there hide or destroy event?

Hi all :slight_smile:

First of all, thank you for providing such a wonderful library!

I’m working on in-house product (VAADIN + Clojure) where application connects to remote database cluster to fetch some data. This data is processed by application and displayed inside user browser with a bit complex layout (TabSheet + Table + Tree, couple of horizontal/vertical layouts with charting support using OFCVaadin addon).

Tree is populated with two nodes, Master and Nodes, where the each one is filled with cluster master and nodes addresses or names. When user selects one of addresses, application establish connection to that location, displaying node details with specific charts (charts are different for master and nodes). It will also start separate thread from where it will pool data for real-time chart update.

However, user can also select another node or click on another part of layout which will change the layout, leaving pooling thread still running. For solving this, maybe the best approach would be to have some onDestroy or onHide event attached to chart layout, called every time it gets shown or hidden; from it, polling thread could be easily stopped or restarted.

Is there such event or maybe someone would use a different approach?

Thank you.
Sanel

Hi,

Components has attach() and detach() methods which can be overriden, and there is also
ComponentAttachListener
and
ComponentDetachListener
in ComponentContainers.

Hi,

Thank you, it works :slight_smile:

Sanel