Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Business Rules & FieldLevel Validation
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Titre:
Business Rules & FieldLevel Validation
Divers
Thread ID:
00504390
Message ID:
00504390
Vues:
53
Hi All,

A little background before the question.

I have developed code to perform FL validation using the BizRules class. In my subclass of the cTextBoxL I have added some properties to tell me the name of the BizObj the control is associated with as well as the validation method within the BizRule class. When the user attempts to exit a field and field level validation is active for the control the validation method of the of BizRule fires and a message displayed if necessary. Thus far works OK.

Now for the issue: How can I display the caption to the field vice hardcoding when the BizRules are called by the BizObj upon save? For example, a cTextBoxL control with the caption "Last Name". During field level I could (not doing this now) pass the Label.Caption property to the validation method where it would be incorporated into the error message. During form level using the same method there is no way for the validation method to know Label.Caption. Any Ideas? I'm trying to maintain consistency and maintainability -- so changing the Label.Caption does not require a change in the validation method and messages all display the same whether field level or form level without hard coding some like 'Last Name'.

On idea I've had in passing is to create a custom validation class for each control then cycle through each control upon save sending any error messages to a common repository. Seems odd, like it violates three-tier "principles". However, on the other hand, it seems on the surface to promote maximum re-usability.

Anyone of have any suggestions or comments (positive, negative, improvements) on how I'm doing what I am doing, I'd love to hear 'em.


TIA

Bob
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform