Popups

Hello.

I have ONE 8.2.6 and am trying to figure out opening popups with PROCESS PAGE MODAL.
The Help system contains an example with a program and a subprogram like this: (see attachment)


/** New Program PAGE1-P.
DEFINE DATA LOCAL
1 FIELD1 (A) DYNAMIC
1 FIELD2 (A) DYNAMIC
END-DEFINE

/* The following page will be opened in a normal browser window.
PROCESS PAGE USING 'PAGE1-A'
DECIDE ON FIRST *PAGE-EVENT
  VALUE U'nat:page.end', U'nat:browser.end', U'onClose'
    /* Page closed.
    IGNORE
  VALUE U'onPopup'
    /* Open a pop-up window with the same fields.
    CALLNAT 'POPUP1-N' FIELD1 FIELD2
    PROCESS PAGE UPDATE FULL
  NONE VALUE
    /* Unhandled events.
    PROCESS PAGE UPDATE
END-DECIDE

END

/** New Subprogram POPUP1-N.
DEFINE DATA PARAMETER
1 FIELD1 (A) DYNAMIC
1 FIELD2 (A) DYNAMIC
END-DEFINE

/* The following page will be opened as pop-up.
PROCESS PAGE MODAL
  PROCESS PAGE USING 'POPUP1-A'
  DECIDE ON FIRST *PAGE-EVENT
    VALUE U'nat:page.end', U'nat:browser.end', U'onClose'
      /* Page closed.
      IGNORE
    VALUE U'onPopup'
      /* Open a pop-up window with the same fields.
      CALLNAT 'POPUP1-N' FIELD1 FIELD2 
      PROCESS PAGE UPDATE FULL
    NONE VALUE
      /* Unhandled events.
      PROCESS PAGE UPDATE
  END-DECIDE
END-PROCESS

END

Now let us execute the program and try out the following.

  • Enter “A” into field 1 and then click on the Popup button.
    Then popup 1 shows “A” in field1. Ok.
  • Replace “A” in popup 1 by “B” and click on the Popup button again.
    Then popup 2 shows “B” in field1. Ok.
  • Drag popup 2 away a little so that popup 1 shows.
    Replace “B” by “C” in popup 2.
    Check that “B” is still shown in popup 1.
  • But now click on the Close button in popup 2.
    RESULT: Popup 2 closes and a side effect happens in popup 1: “C” appears in field1 instead of “B”.
  • Click on the Close button in popup 1.
    In the original base window the “A” still remains and is not replaced by “C”.

Obviously, adding a BY VALUE clause to the parameter definition in the subprogram, we avoid the side effect altogether. But this is not the question.

Many thanks,
Hubert

popup-project.zip (25.6 KB)