Popup Window Closing problem

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.

Namaste Shakil,

What you should is edit gx_closeWindow event in GXBasicContext.java.

Here

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

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

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;

    private static Logger logger = Logger.getLogger(RD0060P2_ConfirmSubmit.class);

    /** Post back submit Y to MF popup for confirmation. */
    public void DoYes() {
    try {
    GXSendKeysRequest skr = gx_prepareSendKeysRequest(“[enter]”);
    skr.addInputField(“AutomatedAgencyLoadJob”, “Y”);
    sendKeys(skr);
    gx_handleHostResponse();
    } catch (GXGeneralException e) {
    gx_handleSessionError(e);
    }
    }

    /** Post back submit N to MF popup for confirmation. */
    public void DoNo() {
    try {
    GXSendKeysRequest skr = gx_prepareSendKeysRequest(“[enter]”);
    skr.addInputField(“AutomatedAgencyLoadJob”, “N”);
    sendKeys(skr);
    gx_handleHostResponse();
    } catch (GXGeneralException e) {
    gx_handleSessionError(e);
    }
    }
    }

Once again thanks for helping me.

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

gx_doCloseWindow(""); 

And it should appear after -

getGXSession().sendKeys(skr);

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

ok Asaf,
Later i will keep this in mind .