Hi All,
I have a requirement to open a Pop-up. I have created two generated/customized jsps.say (parent.jsp,child.jsp).
I have implemented the following stuff in parent.jsp for opening pop-up,
////==========================================
function PopUPOpen(){
gx_window.open(“child.jsp”,200,300,0,0);
}
////==========================================
I am getting a js error (‘gx_window is undefined’).
Also I would like to mention it is not necessary to open a pop-up using javascript, is there any other way in server side to do the same then please suggest.
It would really help us to know what are you trying to achieve.
Does the child window represent a host-window or does it suppose to be independent page opened from the parent page?
Does the parent.java class extends GXDefaultContext or GXBasicContext?
And again, please describe the scenario you’re trying to implement both on the client side as well as the Host side. This way we’ll be able to better understand the problem you’re facing.
Does the child window represent a host-window or does it suppose to be independent page opened from the parent page?
ANS : Child window represents a host-window… in mainframe this child window is a main screen (not a pop up).
Does the parent.java class extends GXDefaultContext or GXBasicContext?
ANS: parent.java extends GXDefaultLogicContext.
The business requirement is to provide the user input data from a Look-up screen (which is currently getting displayed as a Host Screen by pressing a PF-Key from the parent screen in mainframe) as a pop-up from the parent screen.
public void gx_changeNextForm(GXIHostPageContext gx_context,GXChangeNextFormEvent event)throws GXGeneralException{
// Occurs before loading the next page, by gx_handleHostResponse.
// Use event.setNextForm(“”), for example logon.jsp , to change the next page.
String curScr = gx_context.getGXSession().getScreen().getName();
if (curScr.equals(“”)){
event.setLoadAsWindow(true);
}
}
Then:
public void gx_preOpenWin(GXIHostPageContext gx_context,GXPreOpenWinEvent event) throws GXGeneralException{
if (gx_context.getGXSession().getScreen().getName().equals(“”)){
event.setOpenWin(true);
}
}
Changing that code SHOULD open the screen in a new window, however, there is a bug and the window doesn’t open. Please open a support request for that and use the code above once that bug is solved.
now i am getting “gx_window is undefined” after implementing suggested changes in the corresponding files.
I am using Applinx 5.2.5.0047, and have commented earlier suggested changes also but getting the same “gx_window is undefined” java script error message. earlier, it was opening parent window, now it is not opening any window.
Note: Could you please provide me link where I can see differences between old and new versions.
Earlier Suggested changes in this post:
Change GXBasicContext methods
public void gx_changeNextForm(GXIHostPageContext gx_context,GXChangeNextFormEvent event)throws GXGeneralException{
// Occurs before loading the next page, by gx_handleHostResponse.
// Use event.setNextForm(“”), for example logon.jsp , to change the next page.
String curScr = gx_context.getGXSession().getScreen().getName();
if (curScr.equals(“”)){
event.setLoadAsWindow(true);
}
}
Then:
public void gx_preOpenWin(GXIHostPageContext gx_context,GXPreOpenWinEvent event) throws GXGeneralException{
if (gx_context.getGXSession().getScreen().getName().equals(“”)){
event.setOpenWin(true);
}
}
I’ve tested the solution I referred to in the JSP CompositeDemo and it worked, so I assume that there are some other things in your web page which prevent from the gx_window object to load. Please open a support request and provide your web application.
Please note that the version you have is out of support. I recommend upgrading to a newer version.
Regarding the earlier suggested changes in this post, this is not exactly your use case. The use case there is to open a window of the host screen as a popup though it is not a real window in the host application.
The solution that you ask for is to open a popup window which is not related to a host screen at all.