4.1.4 WC - SolutionModel Not Removing Form

Hey Guys,

I have a solution that creates forms on-the-fly. It allows the user to define some stuff for a form - and then change their mind, and change the definition.

This means that I have to remove the form (using history.removeForm first, then solutionModel.removeForm) and then re-create the form and show it.

In Smart Client - this works no problem.

In Web Client - the first build of the form works - then it seems to NOT remove the last form (in this test case it’s a set of 4 forms - and 1-3 are removed fine in web client, but form 4 is not removed - the function call solutionModel.removeForm returns false.).

What could cause the solutionModel to not remove a form? There are no errors in the log…

4.1.4
Mac - Leopard

is that form visible in the ui somewhere?

I opened a separate window (wc) to look at the forms. Then I closed the window.

Does Servoy “think” the form is still visible even when you close that window (FID - non modal)?

Johan, that’s what it was. It was still considered to be “visible” by the headless - even though the window had been closed.

in the webclient if you just close tabs or windows. Servoy doesnt know that
The window.close calls are very unreliable over browsers and you can’t depend on it.

Right - so is there a better way? How do you get Servoy to “know” that the form is not visible anymore in the web?

dont close the tab. But close it through a button or something like that.
Or just fake it and fake close it (set an empty form in it) when you want to change it in the code.

Hi Bob

And don’t forget that in the onShow method isFirstTime (arguments[0]) is always true! If you use that.

Regards, Robert

bobcusick:
Hey Guys,
This means that I have to remove the form (using history.removeForm first, then solutionModel.removeForm) and then re-create the form and show it.

In Web Client - the first build of the form works - then it seems to NOT remove the last form (in this test case it’s a set of 4 forms - and 1-3 are removed fine in web client, but form 4 is not removed - the function call solutionModel.removeForm returns false.).

What could cause the solutionModel to not remove a form? There are no errors in the log…

4.1.4
Mac - Leopard

OK! Thanks very much, guys!