How to close / destruct a subform?

Vik Shah Vik at
Thu Dec 16 07:09:43 EST 2010


The $multipleclasses is set to kFalse, and at execution time we cannot issue
a $root.$clearcachedforms() as it will interrupt others sessions.

While what I see is mainly during the development, we do have cases whereby
the same remote form is opened multiple times and closed multiple times.

In such an event the instance lingers, this is a serious issue.

I am sure that I am not the only one using a subwindow/subform with this

My feeling is that the lingering instances could explain the memory leaks
(but not memory leaks) we have been noticing over the years. What we see is
that omnis memory usage keeps growing slowly but surely, until omnis runs
out of its useable memory space.

Any other takers?

Vik Shah

On 16/12/10 7:55 PM, "Andrew Clow" <andrew at> wrote:

> Hi Vik,
> Do $cinst.$objs.subFormField.$multipleclasses.$assign(kFalse) ;;will force a
> destruct of all subForm instances that aren't in use. (assign(kTrue) before
> assigning next $classname)
> You may choose to leave it off since it sounds like you're already closing
> them with the intention they stay closed.
> That and $root.$clearcachedforms() were very useful for us during webclient
> testing.
> <Manual>
> Subform Caching
> The $multipleclasses property tells Omnis to keep a set of remote form
> instances open for use in the subform object, rather than constructing a new
> instance each time the class is changed. When you assign a new remote form
> name to $classname at runtime, the new remote form is downloaded to the client
> and displayed in their browser. If $multipleclasses is enabled, the previous
> remote form is cached and hidden on the client, otherwise the remote form
> instance is destroyed. If any previous remote forms have been cached in this
> way using $multipleclasses, you can switch back to them instantaneously,
> otherwise they have to be reloaded each time you assign to $classname of the
> subform object.
> </Manual>
> Regards,
> Andrew.
> On 16/12/2010, at 7:07 PM, Vik Shah wrote:
>> Hello,
>> In our Web Client application we have got a few subform's that we use
>> commonly amongst many parts of our application. I was navigating in such a
>> way that I specifically closed off all the remote forms that I did not need.
>> When I tried to view the subform's stack (from the omnis IDE) and select the
>> active subform, to my surprise I found many instances of that subform still
>> running.
>> Thinking that I was seeing double (its late in the day...) I repeated this
>> and the results are the same.
>> When you open a remote form that has a subform and then close the remote
>> form using $ctask.$closeform('the_rf_name') the $destruct of the closing
>> remote form runs but the $destruct of the sub-form's instance does *not*
>> run.
>> Am I missing something obvious here, how do I close a subform?
>> Looking at the manual, the subforms/subwindows should destruct when the
>> parent form/window closes.
>> Has anyone seen this behaviour?
>> Vik Shah
>> CIO 
>> mystrata Pty. Ltd.
>> _____________________________________________________________
>> Manage your list subscriptions at
> _____________________________________________________________
> Manage your list subscriptions at

More information about the omnisdev-en mailing list