Hi guys,
This is my first time seeing Unload() event in action and it's doing something not quite expected.
My solution has multiple windows and every window is made of clones of the original window. Literally each form is a solutionModel clone, because I need to show the same window on the screen more than once at any particular time.
The problem appears when I open more than three or four windows and 'pre-load' a couple of them in memory without showing them to the user. Servoy starts its own memory management and unloads some forms, that are not currently on the screen.
Now, when I bring those forms up on the screen, Servoy loads them back, however they have original tab forms links.
I'll explain.
When I clone a window, I also clone all forms on its tabpanels.
After the cloning has finished, I load the forms (just calling forms[formName]) and then remove all original tabs and replace them with the cloned tabs.
So, if I had form 'job' that contained a tabpanel with form 'job_details' (that's stage 1), after cloning (stage 2) it will be 'job_clone' containing 'job_details' and after loading form 'job_clone' (stage 3) it will be 'job_clone' containing 'job_detail_clone'. Tabs are removed with .removeAllTabs() and put back with .addTab(), so it's not solutionModel changes.
Everything is fine till the point when Servoy unloads some forms, like 'job_clone'.
When it brings it back and reloads it, the form is back to stage 2: form 'job_clone' has tab 'job_detail' instead of 'job_detail_clone'. Obviously it ruins a lot of things, as I rely on a particular form being in a particular tab.
I would like to know if that is what is supposed to happen or it's a bug, it doesn't sound right.
Also, I'd like to know how to deal with it. I assume I'll be advised to replace tabs at the cloning stage with solutionModel, but that is how it used to be and we refused that method for a few reasons.
Thanks for your feedback, looking forward to a discussion.