Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 529
  • Last Modified:

Parent/Child JSP

I have request to create a parent JSP And from there I need to open a popup window(another JSP) and disable parent window and what ever I select it need to carried to parent window closing the child window.

Please let me know the best way to do this.

First Action Class - will bring First JSP and clicking search button (Second Action) should open pop up JSP and in POP up if we select some thing that need to be populated in parent JSP(With out calling the first action )
0
nzdjava
Asked:
nzdjava
  • 2
2 Solutions
 
Amitkumar PanchalSr. ConsultantCommented:
Try the following out.

1, Add java script functions to the parent jsp.
var popupWindow=null;

// function to open child window
function popup() {
    popupWindow = window.open('child_page.html','name','width=200,height=200');
}

// function to disable parent window. This will be called when pop-up is opened and trying to access parent window
function parent_disable() {
    if (popupWindow && !popupWindow.closed) {
        popupWindow.focus();
    }
}

Open in new window


2, Call java script functions on onFocus or onClick of parent window. This is again in parent jsp
<body onFocus="parent_disable();" onclick="parent_disable();">

Open in new window


Hope this helps.
0
 
nzdjavaAuthor Commented:
Thanks.
If a value got selected in child window(child JSP) that value need to be populated on parent window with out refreshing the parent JSP
0
 
Amitkumar PanchalSr. ConsultantCommented:
If a value got selected in child window(child JSP) that value need to be populated on parent window with out refreshing the parent JSP

EE already has solution to this. Please refer http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28057344.html
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now