Consultor Eletrônico



Kbase 20630: ADM. How To Create a Radio-Set With Nothing Selected
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/7/2010
Status: Verified

GOAL:

4GL/ABL: How to clear the default selection of RADIO-SET?

GOAL:

How to make a RADIO-SET with nothing selected?

FACT(s) (Environment):

Progress 8.x
Progress 9.x
OpenEdge 10.x
All Supported Operating Systems

FIX:

Write an internal procedure to using the RADIO-SET widget DELETE method to delete all the existing radio-buttons its to add them again using the RADIO-SET widget ADD-LAST method . For example:

PROCEDURE clearRadioSet:
RADIO-SET-1:DELETE("Item 1") IN FRAME {&FRAME-NAME}.
RADIO-SET-1:DELETE("Item 2")IN FRAME {&FRAME-NAME}.
RADIO-SET-1:DELETE("Item 3")IN FRAME {&FRAME-NAME}.
RADIO-SET-1:ADD-LAST("Item 1", "1")IN FRAME {&FRAME-NAME}.
RADIO-SET-1:ADD-LAST("Item 2", "2")IN FRAME {&FRAME-NAME}.
RADIO-SET-1:ADD-LAST("Item 3", "3")IN FRAME {&FRAME-NAME}.
END PROCEDURE.

The above clearRadioSet internal procedure may be called from any where in the application. To initialize the window with no selected RADIO set buttons, call the above procedure immediately after the RUN enable_UI. statement. For example:
MAIN-BLOCK:
DO ON ERROR UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK
ON END-KEY UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK:
RUN enable_UI.
RUN clearRadioSet.

IF NOT THIS-PROCEDURE:PERSISTENT THEN
WAIT-FOR CLOSE OF THIS-PROCEDURE.
END.