How to close / destruct a subform?

Andrew Clow andrew at freedomsoftware.co.nz
Thu Dec 16 04:55:10 EST 2010


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 http://lists.omnis-dev.com




More information about the omnisdev-en mailing list