Progress
Programming
Handbook
The Rules of Frame-based Validation
In Progress, validation of user input is a frame-based activity. The compiler adds validation expressions to a frame from the Data Dictionary the first time a field is referenced in that frame in an input statement (ENABLE, PROMPT–FOR, SET, UPDATE). The compiler adds programmatic validation (VALIDATE option) to the frame when it is encountered, as long as it has not already compiled in Data Dictionary validation. So, if you want programmatic validation to override existing Data Dictionary validation it is safest to place it in the DEFINE FRAME, FORM, or DEFINE BROWSE statement. After the compiler adds initial validation for a field in a frame, all other validation for that field in that frame is ignored.
To take advantage of this default behavior, add all of your default validation to database schema and use the VALIDATE option for special cases. Since the default behavior is frame-based, you can use different validation for the same field in different frames.
The ENABLE statement with the ALL option poses a special problem for the compiler, since it cannot know syntactically which fields in the frame require Data Dictionary validation. To avoid possible validation holes, the compiler adds Data Dictionary validation for all fields in the frame, even if they are defined as non-sensitive widgets. If you add a field to a frame after the compiler encounters the first ENABLE ALL statement, Data Dictionary validation will not be added to the frame for this field. To avoid creating a possible validation hole, do not add new fields to frames, or use the VALIDATE option to provide programmatic validation.
If you use the EXCEPT option with ENABLE ALL, the compiler will not add Data Dictionary validation to the frame for the fields listed with EXCEPT.
Finally, note that Progress does not have any default validation behavior for the widget:SENSITIVE = YES syntax. Using this back–door technique for enabling fields for input creates a validation hole. If you use this technique, then you will have to force frame-wide validation to close any possible validation holes. The next section discusses frame-wide validation techniques.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |