Previous Topic: DISABLE and ENABLE StatementsNext Topic: MARK and UNMARK Statements


DISABLE Statement for a Push Button

 --- IF export_credit ief_supplied total_currency IS EQUAL TO
|        export_debit ief_supplied total_currency
|--- ENABLE COMMAND post
|    ELSE
 --- DISABLE COMMAND post

When using the CA Gen disabling feature built into menu items and push buttons, enabling is automatic. Menu items and push buttons are enabled when the disabling conditions are not met.

When DISABLE is used, the affected selection must be later enabled through action logic, if the selection is ever to be used.

Disable can also be used with modeless windows or dialog boxes to prevent users from inadvertently opening multiple dialog boxes at one time. For example, there are separate modeless boxes for add, change, and delete. When the user selects one of the push buttons, the other two are disabled.

Take care when disabling selections. With the emergence of the GUI, the traditional approach of letting the user type in all the data and then validating is replaced with disallowing certain controls and fields depending on which field the user entered data. Data validation went from reactive to preventive. It sounds like a good idea to disable the OK button until all the required data is filled in, and all the subordinate dialog boxes have been visited and their data has been filled in as well. But it turns out it is not such a good idea if there are several required and optional fields, several combinations of required fields, or required subordinate dialog boxes. A user can become frustrated trying to figure out what needs to be done before the OK button becomes enabled.

You should analyze each situation for the best approach to this issue. These are alternatives to consider: