10. Data Entry Error Handling : How You Can Use Data Entry Error Handlers : How You Can Access a Hierarchy of Data Entry Error Handlers
 
Share this page                  
How You Can Access a Hierarchy of Data Entry Error Handlers
OpenROAD lets a called or opened executable object override the handler specified by its parent by setting its own data entry error handler. The locally invoked error handler can:
Bypass error handlers defined by its parent
Invoke the parent's error handler after executing its own code
When a data entry error handler returns control, the error handler can cause OpenROAD to search parent executable objects for other data entry error handlers defined at higher levels. OpenROAD calls each handler it finds, passing to it all modifications made by previous handlers. If no handler is found, execution resumes as if no search for other handlers was performed.
The integer value returned by a data entry error handler determines whether OpenROAD searches for other error handlers defined by parents. There are two integer values that error handlers return:
EH_RESUME
Causes normal execution to be resumed, displaying non-blank messages in a pop-up; the message can be revised by the code
EH_NEXT_HANDLER
Causes the search for handlers to be resumed, starting with the parent of the executable object in which the current handler was found
If none of the handlers removes the error condition by resetting the field's value, the field triggering the error condition retains input focus and the cursor remains on the error field.
If one of the handlers removes an error condition that was detected when the field attempted to give up input focus, the input focus is changed. Events (such as SetValue) are generated as if the user had entered valid data.
Error handlers that remove an error condition should not return EH_NEXT_HANDLER.
The search for other handlers defined by parent executable objects stops when either no handler is found, or the current handler returns EH_RESUME.