Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
LostFocus and Valid
Message
De
22/05/2001 16:31:56
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00510008
Message ID:
00510071
Vues:
18
>Hi All,
>
>I have a container that contains a mover control inside. The container has a custom valid method that is called in the LostFocus event. All works well unless the control is the last control on the form before the save button then is fails. While in the move control click on the SAVE button, the LostFocus fires, isValid returns .T., but the save is not executed.
>
>Is the work around for this problem?
>
>LOSTFOCUS
>
> IF This.IsValid
> DODEFAULT()
> ELSE
> NODEFAULT
> This.SetFocus()
> ENDIF

Assuming your save button is on a toolbar, the problem is that your control's validation is not firing when you click Save. Toolbars don't retake focus at all. The usual trick is to force a setfocus back to the control before saving, which will in turn fire validation and writing the value into the controlsource (because setting focus to one control forces the previous control to lose it first, never mind that it's the same one).

Just make sure that this.setfocus fires in the right moment, i.e. after you clicked save, but before any actual saving takes place.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform