PreviousNextIndex

DISABLE statement

Disables input for one or more field-level and child frame widgets within a frame that were previously enabled with the ENABLE statement. Disabling a widget prevents the user from providing input to the widget, but does not remove it from the display.

Syntax

DISABLE [ UNLESS-HIDDEN ] 
  {     ALL [ EXCEPT field ... ] 
     |  { field [ WHEN expression ] } ... 
  } 
  { [ frame-phrase ] } 

UNLESS-HIDDEN
ALL [ EXCEPT field ... ]
field [ WHEN expression ]
frame-phrase
Example

In the following example, the CustNum field and the Quit button are initially active. When you press GO in the CustNum field, that field becomes disabled and the Save and Undo buttons and the CreditLimit field are enabled. If you choose either the Save or Undo button, those buttons and the CreditLimit field are again disabled and the CustNum field is enabled again.

r-enable.p
DEFINE VARIABLE ok AS LOGICAL NO-UNDO. 
DEFINE BUTTON b_quit LABEL "Quit" AUTO-ENDKEY.  
DEFINE BUTTON b_save LABEL "Save". 
DEFINE BUTTON b_undo LABEL "Undo". 
DEFINE FRAME butt-frame 
  b_save b_undo b_quit 
  WITH CENTERED ROW SCREEN-LINES - 1. 
   
FORM Customer 
  WITH FRAME cust-info SIDE-LABELS CENTERED 
  TITLE "Update Customer Credit Limit". 
ON CHOOSE OF b_save, b_undo IN FRAME butt-frame DO: 
  DISABLE b_save b_undo WITH FRAME butt-frame. 
  DISABLE Customer.CreditLimit WITH FRAME cust-info. 
  ENABLE Customer.CustNum WITH FRAME cust-info. 
  IF SELF:LABEL = "save" THEN 
    ASSIGN FRAME cust-info Customer.CreditLimit. 
  CLEAR FRAME cust-info NO-PAUSE. 
  APPLY "ENTRY" TO Customer.CustNum IN FRAME cust-info. 
END. 
ON GO OF Customer.CustNum IN FRAME cust-info DO: 
  FIND Customer USING Customer.CustNum EXCLUSIVE NO-ERROR. 
  IF AVAILABLE Customer THEN DO: 
    DISABLE Customer.CustNum WITH FRAME cust-info. 
    ENABLE Customer.CreditLimit WITH FRAME cust-info. 
    ENABLE ALL WITH FRAME butt-frame. 
    DISPLAY Customer WITH FRAME cust-info. 
  END. 
  ELSE DO: 
    MESSAGE "No Customer Record exist for Customer number" 
      INPUT Customer.CustNum ", Please re-enter." 
      VIEW-AS ALERT-BOX WARNING BUTTONS OK-CANCEL UPDATE OK. 
    IF NOT ok THEN 
      APPLY "CHOOSE" TO b_quit IN FRAME butt-frame.  
  END. 
END. 
ENABLE Customer.CustNum WITH FRAME cust-info. 
ENABLE b_quit WITH FRAME butt-frame. 
WAIT-FOR CHOOSE OF b_quit IN FRAME butt-frame 
   FOCUS Customer.CustNum IN FRAME cust-info.  

Note

If you invoke the DISABLE statement for the parent frame of a frame family, the field representation widgets and descendant frames owned by the parent frame are all disabled. However, the field representation widgets of the descendant frames remain enabled and appear sensitive, although they cannot accept input. To disable field representation widgets in the descendant frames and make them appear insensitive, you must invoke DISABLE statements for each of the descendant frames.

See also

ENABLE statement, WAIT-FOR statement (ABL only)


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex