Activate Button in second frame?

Doug Johnson

New Member
How do I make a button "Active" in a second frame? (9.1E, Windows XP) I have an initial frame1 that contains an "ADD" button. Clicking on the ADD button displays a second frame (frame2) that contains a "Cancel" and "Submit" button. However, the ON CHOOSE OF cancel IN FRAME frame2 DO: does nothing. Thanks

Code:
REPEAT:
        ON CHOOSE OF newlocationbutton IN FRAME frame1 DO:

                MESSAGE "ADD". /* THIS WORKS */
                HIDE FRAME frame1. /* THIS WORKS */
                ENABLE cancel submit WITH FRAME frame2.
            
                ON CHOOSE OF cancel IN FRAME frame2 DO: /* THIS DOES NOT WORK */
                        MESSAGE "CANCEL".
                        HIDE FRAME frame2. 
                        VIEW FRAME frame1.
                END.
                ON CHOOSE OF submit IN FRAME frame2 DO: /* THIS DOES NOT WORK */
                        HIDE FRAME frame2. 
                        VIEW FRAME frame1.
                END.
        END.


        
        PAUSE 0 BEFORE-HIDE.
        ENABLE ALL WITH FRAME frame1.
        WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW.
END.
 

rzr

Member
dirty but works...

Code:
[FONT=courier new]DEFINE BUTTON newlocationbutton LABEL "newlocationbutton".
DEFINE BUTTON cancel            LABEL "cancel".
DEFINE BUTTON submit            LABEL "submit".[/FONT]
[FONT=courier new]DEFINE FRAME frame1 
    newlocationbutton AT ROW 2 COL 20 .[/FONT]
[FONT=courier new]DEFINE FRAME frame2 
    cancel AT ROW 5 COL 40 
    submit AT ROW 6 COL 40.[/FONT]
[FONT=courier new]
ON CHOOSE OF newlocationbutton IN FRAME frame1 DO:
    
    MESSAGE "ADD" VIEW-AS ALERT-BOX. /* THIS WORKS */
    HIDE FRAME frame1. /* THIS WORKS */
    RUN P_Frame2.
END.[/FONT]
[FONT=courier new]
ENABLE ALL WITH FRAME frame1.
WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW.[/FONT]
[FONT=courier new]
PROCEDURE P_Frame2:[/FONT]
[FONT=courier new]    ON CHOOSE OF cancel IN FRAME frame2 DO: /* THIS DOES NOT WORK */
        MESSAGE "CANCEL" VIEW-AS ALERT-BOX.
        APPLY "U1" TO THIS-PROCEDURE.
    END.
        
    ON CHOOSE OF submit IN FRAME frame2 DO: /* THIS DOES NOT WORK */
        MESSAGE 'SUBMIT' VIEW-AS ALERT-BOX INFO BUTTONS OK.
        APPLY "U1" TO THIS-PROCEDURE.
    END.[/FONT]
[FONT=courier new]    ENABLE ALL WITH FRAME frame2.
    WAIT-FOR "U1" OF THIS-PROCEDURE.[/FONT]
[FONT=courier new]    HIDE FRAME frame2.
    VIEW FRAME frame1.[/FONT]
[FONT=courier new]END PROCEDURE.
[/FONT]
 
Top