Consultor Eletrônico



Kbase P96977: How to define a shared fill-in in the UIB / AppBuilder and keep its initial value?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/2/2004
Status: Unverified

GOAL:

How to define a shared fill-in in the UIB / AppBuilder without having its initial value reset to unknown.

FACT(s) (Environment):

Windows

FIX:

Defining a fill-in as shared causes the UIB to reset its initial value to unknown ? when the window is saved and reopened. One way to define a shared fill-in and have its initial value preserved is:
1. Open a new window.
2. Drop the fill-in where you need it.
3. Set the SHARED attribute of the fill-in in its property sheet.
4. Use compile -> code preview to locate and copy the definition of the fill-in:
DEFINE {&NEW} SHARED VARIABLE FILL-IN-1 AS CHARACTER FORMAT "X(256)":U INITIAL ?
LABEL "Fill 1"
VIEW-AS FILL-IN
SIZE 14 BY 1 NO-UNDO.
5. Use the compile -> code preview to locate and copy the definition of the frame:
DEFINE FRAME DEFAULT-FRAME
FILL-IN-1 AT ROW 8.62 COL 28 COLON-ALIGNED
WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
SIDE-LABELS NO-UNDERLINE THREE-D
AT COL 1 ROW 1
SIZE 80 BY 16.
6. Use the compile -> code preview to locate and copy the DISPLAY and ENABLE statements from the enable_UI procedure:
DISPLAY FILL-IN-1
WITH FRAME DEFAULT-FRAME IN WINDOW C-Win.
ENABLE FILL-IN-1
WITH FRAME DEFAULT-FRAME IN WINDOW C-Win.
7. Delete the fill-in from the window.
8. Insert the fill-in definition based on the text saved in step 4 above in the windows definitions section:
DEFINE NEW SHARED VARIABLE FILL-IN-1 AS CHARACTER FORMAT "X(256)":U INITIAL "myValue" LABEL "Fill 1"
VIEW-AS FILL-IN
SIZE 14 BY 1 NO-UNDO.
9. Insert the frame definition using the text saved in step 5 above in the windows definitions section:
DEFINE FRAME DEFAULT-FRAME
FILL-IN-1 AT ROW 8.62 COL 28 COLON-ALIGNED
WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
SIDE-LABELS NO-UNDERLINE THREE-D
AT COL 1 ROW 1
SIZE 80 BY 16.
10. Insert the DISPLAY and ENABLE statements saved in step 6 above before the RUN enable_UI statement in the windows main block section:
DISPLAY FILL-IN-1
WITH FRAME DEFAULT-FRAME IN WINDOW C-Win.
ENABLE FILL-IN-1
WITH FRAME DEFAULT-FRAME IN WINDOW C-Win.
11. Save and run the window.