# Popup Window Closing problem

**URL:** <https://techcommunity.softwareag.com/t/popup-window-closing-problem/76134>\
**Category:** Forum\
**Tags:** Mainframe-Integration, ApplinX\
**Created:** [February 12, 2008, 10:12am UTC](https://techcommunity.softwareag.com/t/popup-window-closing-problem/76134 "2008-02-12T10:12:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shakil](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@Shakil](https://techcommunity.softwareag.com/u/Shakil)\
**Post date:** [February 12, 2008, 10:12am UTC](https://techcommunity.softwareag.com/t/popup-window-closing-problem/76134/1 "2008-02-12T10:12:48Z")

</div>

Hi,

Can anybody tell me how to add input for popup window to mainframe host using script in jsp page without calling java file function directly from jsp. In my project there is a popup confirmation screen on mainframe and it requires Y/N input values to perform further operation. I have given two buttons SUBMIT and CANCEL for user.If he is clicking on them everthing is fine. But if client is closing window using X option, i have to pass N to cancel operation to mainframe. When i am calling DoCancel() in java file using

function page\_WindowOnUnLoad() {

```
      gx_postBack('DoCancel');
   }

```

It is closing main window also. please… help me.

---

<div class="post-metadata">

**Author:** ![Asaf\_Shak](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@Asaf\_Shak](https://techcommunity.softwareag.com/u/Asaf_Shak)\
**Post date:** [February 14, 2008, 5:24pm UTC](https://techcommunity.softwareag.com/t/popup-window-closing-problem/76134/2 "2008-02-14T17:24:25Z")

</div>

Namaste Shakil,

What you should is edit gx\_closeWindow event in GXBasicContext.java.

Here

---

<div class="post-metadata">

**Author:** ![Shakil](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@Shakil](https://techcommunity.softwareag.com/u/Shakil)\
**Post date:** [February 14, 2008, 8:04pm UTC](https://techcommunity.softwareag.com/t/popup-window-closing-problem/76134/3 "2008-02-14T20:04:23Z")

</div>

Thanks Asaf,  
Actually what you have given i got this idea and tried but first popup window is closing and after it’s comming as main window for a moment and goes.Rather than this everything is fine.Can you tell me why popup again is comming as main window? even i had override gx\_closeWindow() function for popup screen corresponding java file but same thing.

Thanks again Asaf for helping as now i moved project to test env.

Because I told to mainframe team if they will add one key( in my case [PF4]) it will work. And as i thought its working because for every modal window its calling gx\_closeWindow() that is passing [PF4] key using gx\_doCloseWindow([“[PF4]”]).  
One more thing for upcomming project on Applinx i need your appriciation and help.

Regards,  
Shakil

---

<div class="post-metadata">

**Author:** ![Asaf\_Shak](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@Asaf\_Shak](https://techcommunity.softwareag.com/u/Asaf_Shak)\
**Post date:** [February 17, 2008, 4:18pm UTC](https://techcommunity.softwareag.com/t/popup-window-closing-problem/76134/4 "2008-02-17T16:18:10Z")

</div>

Hi Shakil,  
I was a little bit confused by your last replay. Can you explain to me again (in new words) what exactly was the problem with the new code we gave you? and what is the issue with the [pf4]?  
What is the status of you request from the Mainframe team?  
Please send me GCT of the problems you have and the java file you created using the code we gave you and I will try to help.  
Regards,  
Asaf

---

<div class="post-metadata">

**Author:** ![Shakil](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@Shakil](https://techcommunity.softwareag.com/u/Shakil)\
**Post date:** [February 18, 2008, 9:02am UTC](https://techcommunity.softwareag.com/t/popup-window-closing-problem/76134/5 "2008-02-18T09:02:48Z")

</div>

Hi Asaf,

sorry i have n’t tried your code but what i tried was same as your code .see

public void gx\_closeWindow(){

```
	  try { 
               
            if (getGXSession().getScreen().getName().equals("RD0060P2_ConfirmSubmit")|| getGXSession().getScreen().getName().equals("RD0060P2_DeleteJob")){ 
                    
                    GXSendKeysRequest skr = new GXSendKeysRequest("[enter]"); 
                    skr.addInputField("AutomatedAgencyLoadJob","N"); 
                    getGXSession().sendKeys(skr); 
                    
                    
              } 
              else{ 
           
                     gx_doCloseWindow("[pf4]");                 
              } 
        } catch (GXGeneralException e) { 
             
              e.printStackTrace(); 
        } 

   
}

```

This was the code that i was using. Using this first on closing X window was closing but again comming as main window for a moment and after that i got desired result.Actually my applinx Tax Processing System application is comming from SmartWeb application’s Tools link and we have setted two rectangle areas for main window and popup window in GXBasicContext file .  
FYI mainframe team had accepted my request and now everthing is fine.  
Below i am showing one java file of popup window so that you can understand problem well.

package contexts;

import org.apache.log4j.Logger;  
import com.sabratec.applinx.baseobject.GXGeneralException;  
import com.sabratec.applinx.baseobject.GXSendKeysRequest;

/\*\*

- Confirmation popup for RD0060P2 screen SubmitJob option.  
_/  
public class RD0060P2\_ConfirmSubmit extends GXDefaultLogicContext {  
/_\* Version number for class. \*/  
private static final long serialVersionUID = 42L;

Once again thanks for helping me.

---

<div class="post-metadata">

**Author:** ![Asaf\_Shak](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@Asaf\_Shak](https://techcommunity.softwareag.com/u/Asaf_Shak)\
**Post date:** [February 18, 2008, 3:31pm UTC](https://techcommunity.softwareag.com/t/popup-window-closing-problem/76134/6 "2008-02-18T15:31:48Z")

</div>

Hi Shakil,  
The code example you sent me that is the same as what I sent you is missing important line.  
The line is -

```auto
gx_doCloseWindow(""); 
```

And it should appear after -

```auto
getGXSession().sendKeys(skr);
```

This should solve the problem of pop up window coming as main window.  
I

---

<div class="post-metadata">

**Author:** ![Shakil](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@Shakil](https://techcommunity.softwareag.com/u/Shakil)\
**Post date:** [February 18, 2008, 3:59pm UTC](https://techcommunity.softwareag.com/t/popup-window-closing-problem/76134/7 "2008-02-18T15:59:50Z")

</div>

ok Asaf,  
Later i will keep this in mind .

---

<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, 2:49pm UTC](https://techcommunity.softwareag.com/t/popup-window-closing-problem/76134/8 "2021-04-02T14:49:08Z")

</div>


