Solved

Parent/Child JSP

Posted on 2014-10-06
4
430 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 21

Assisted Solution

by:Amitkumar Panchal
Amitkumar Panchal earned 500 total points
ID: 40365208
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
ID: 40366947
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 21

Accepted Solution

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Configure Web Service (server application) I. Configure security for Web Services methods First, we need to protect Session bean which implements the service: 1. Open EJB deployment descriptor (ejb-jar.xml) in the EJB project that contains you…
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 learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

820 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