# Popups

**URL:** <https://techcommunity.softwareag.com/t/popups/171339>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, NaturalONE, NaturalONE-Full-Edition, Natural-on-Windows-Unix\
**Created:** [June 5, 2013, 8:58am UTC](https://techcommunity.softwareag.com/t/popups/171339 "2013-06-05T08:58:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hubert\_Kauker1](https://avatars.discourse-cdn.com/v4/letter/h/58f4c7/32.png) [@Hubert\_Kauker1](https://techcommunity.softwareag.com/u/Hubert_Kauker1)\
**Post date:** [June 5, 2013, 8:58am UTC](https://techcommunity.softwareag.com/t/popups/171339/1 "2013-06-05T08:58:03Z")

</div>

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)

```auto

/** 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
```

```auto

/** 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”.

> [@](#):
>
> Why is the side effect not observed in the base window?

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](https://techcommunity.softwareag.com/uploads/short-url/suSbACI0LfFV6VXIAgAU0QnBDf2.zip) (25.6 KB)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:28pm UTC](https://techcommunity.softwareag.com/t/popups/171339/2 "2021-04-02T15:28:55Z")

</div>


