Forms in tab panels disappearing

This is related to not being able to show the same form more than once on another form.

I have sets of screens (“main screens”) that I load dynamically into a tab panel on a “shell screen” depending on which navigation item was selected. These loaded screens have lots of tab panels on them with usually many “sub forms” crammed into them.

If a “sub form” is shared by more than one “main screen” – no problem when you are flipping between the main screens the usual way.

However, if the way you are flipping between the main screens is to dynamically load them into a tab panel on another (“shell”) screen, then a sub form will disappear from a main screen when it is loaded if the previously loaded main screen was showing the same sub form.

Tabbing away and then back to the sub form reloads it.

Not sure if this is a bug or just a strange way that we have hit on not being able to view the same form twice on a screen! Even though the form is not shown at the same time twice with this set of circumstances.

Hi David,

Sometimes you can get stange things happing if the foundset of a form becomes ambigous. Basically you use a subform in 2 or more contexts, and somehow Servoy becomes unable to decide which context to use…

Confusing, but easy to fix, use separate found set and load the records manually.

Sorry can’t give you a specific example.

I ran accorss this a while back, I duplicated the sub forms. I hope it is a bug rather then expected behavoir.

See attached diagram.

The foundsets are not what is causing Servoy to get confused in this case. It is the result of dynamically unloading and reloading a tab panel at run time.

If forms B and C are “hardcoded” on a tab panel on form A, form D will never get confused and disappear. It will show up when form B is showing on form A and show up when form C is the form showing on form A.

If however, if you dynamically load form B into the tab panel on form A, and then dynamically unload form B and load form C – at this point form D will disappear from form C.

I would guess that form A still thinks form D is on the form even though it got unloaded along with from B. So when it is reloaded again attached to form C, it doesn’t show it since Servoy will not show the same form twice on a form. Caching issue?

swingman:
Hi David,

Sometimes you can get stange things happing if the foundset of a form becomes ambigous. Basically you use a subform in 2 or more contexts, and somehow Servoy becomes unable to decide which context to use…

Confusing, but easy to fix, use separate found set and load the records manually.

Sorry can’t give you a specific example.

How do you manually load records to a tab panel?

Do a search with a method on the form that the tab panel is showing (or showAllRecords). You can attach the method to the onShow property of the form.

so what you do is this
You manually load a form C in a tab of main form A and also in a tab of main form B?

Then you switch between them and the dissappear?

can you give me an example solution where you explain this:

“However, if the way you are flipping between the main screens is to dynamically load them into a tab panel on another (“shell”) screen, then a sub form will disappear from a main screen when it is loaded if the previously loaded main screen was showing the same sub form.”

So the main screen of A that has C as tab you make a tab of B?