Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Refresh
Message
 
À
28/03/2003 03:51:15
Information générale
Forum:
Visual FoxPro
Catégorie:
CodeMine
Titre:
Divers
Thread ID:
00771077
Message ID:
00771233
Vues:
13
Morning, Sir.

>The form.refresh() is happening because CM, on closing a form checks to see whether there are any changes to the data. Even if there are no changes, it call the form's save method which in turn calls the form's RefreshAll() method. This is where you form.Refresh behaviour is coming from.

Yup, I went through the framework and found out the ways things were happening. By the way, the "kids" are separate forms. What is even better is, when I close a ChildForm, it runs the Refresh once, but if I close the Parent, it goes once for the Parent, and then the "kids".


>What you could do is subclass the form's QueryUnload method and before you call dodefault(), the could manually close the "kids". I am not sure from your post whether the "kids" are separate forms or, grids on the parent form. Either way, you can close things down yourself, be sure to save any data (if appropriate) and then return dodefault(). In this case, by the time the CM code calls save->refreshall, you would have tidied up yourself and all of the requerying/refreshing of your grid data (if that is what is happening) will not happen because you took appropriate action in QueryUnload.

Got it, but got a bit scared. Doing things myself runs into a great risk. I was trying to find a way to test, inside the Refresh method, what caused it to run. Something like WasItCalledBy('close') ... Searched the manuals by "Action" and similar key words, but didn't find any Global State telling me something like that.
I created a Property in the forms called lCalledByClose (.F.), which I set to .T. in the BeforeClose, so I can test it inside the refresh. Does it sound reasonable ?

Have a nice day.
Ivan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform