Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Validation on fields in a grid don't prevent button clic
Message
De
07/10/2011 08:13:30
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Divers
Thread ID:
01525801
Message ID:
01525845
Vues:
141
>I have a form with a grid and several buttons. When I add validation to fields in the grid, a failed validation doesn't prevent a button outside the grid from getting focus and clicking. I can't believe I've never noticed this behavior before. Is there an easy way around this? Failing validation on a field in a grid should prevent the form's save button from being clicked, for example.

And how would you handle, for example, a button outside the form - a "Save" button on the main toolbar? In the framework I have been using, such a button invokes a form method, form.OnSave().

For validation, I suggest putting all the validation in the Form.OnSave() method, or however you call the method that handles it. This solves problems as the one you mentioned (and the one I mentioned). It also makes it easier - nay, feasible - to do validations that span more than one field.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform