Is there a way to reinject an initialized modeler into a html canvas element?

I am creating a single-page web application that utilizes bpmn modeller. There are multiple “windows”, the user can switch between. I am currently facing a problem - when a user switches to a different window (the canvas containing the modeller is destroyed) and then switches back, the HTML canvas element is re-added, but the modeller is not automatically injected into this element. Is there a way to manually trigger this process, without having to re-instantiate the whole modeller object? I would like to avoid having to re-instantiate the modeller, as that would result in the loss of the current undo/redo history.

Hi,

It seems that you already cache the modeler instance. Why don’t you cache the container DOM element as well and just mount it when the component is re-rendered?
I don’t think it is possible to specify a container later, as the rendering is already happening during the import.

1 Like

Hi,

for some reason, I have not thought of that option, I have tried it out and it seems to be working great! Many thanks!