Solved

Parent/Child JSP

Posted on 2014-10-06
4
388 Views
Last Modified: 2014-10-13
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
Comment
Question by:nzdjava
  • 2
4 Comments
 
LVL 20

Assisted Solution

by:Amitkumar Panchal
Amitkumar Panchal earned 500 total points
Comment Utility
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
 

Author Comment

by:nzdjava
Comment Utility
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
 
LVL 20

Accepted Solution

by:
Amitkumar Panchal earned 500 total points
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now