Solved

Results from child modal window not populating the parent window

Posted on 2004-09-29
3
417 Views
Last Modified: 2013-12-10
hi,
 
I HAVE PECULIAR PROBLEM IN MY websphere - struts APPLICATION.

i HAVA A MAIN PAGE WITH A BUTTON. WHEN I CLICK ON BUTTON A MODAL WINDOW IS OPENED. i NEED TO FEED THE DATA AND SUBMIT IT. As soon as i click submit the main page is again opening in new window.

Please suggest how to avoid opening new window and also I want to refresh the main page with new results.

It is really urgent. iF POSSIBLE PUT THE COMPLETE CODE

Advance Thanks
0
Comment
Question by:SIVA1
3 Comments
 
LVL 7

Accepted Solution

by:
damonf earned 500 total points
ID: 12190292
Yeah, right ... put the complete code.  Listen, I can help but with what you've given, how could anyone put complete code?

Here's the issue:  if you are using a modal window from IE's showModalDialog method, you simply cannot submit the page to itself.  You have two options:

1)  if you want the modal window to stay open, you have to put a hidden frame like an iframe there and load the page inside the iframe.  Then you can submit normally.

2)  if you just want to submit data back to the main page, you have use the showModalDialog properly.  You pass an object to the modal window via the second argument.  Inside the modal window, you can manipulate the object with javascript and send it back.

Like so:

In main page:

<script language="javascript">
function doIt(){
myVar = new Array("xxx");
alert(myVar[0]); //says "xxx"
result = showModalDialog("myPage.html",myVar);
alert(myVar[0]); //says "yyy"
}
</script>
<input type="button" onclick="doIt()">



In modal:

<script language="javascript">
function doIt(){
newVar = window.dialogArguments;
alert(newVar[0]); //will say "xxx";
window.dialogArguments[0] = "yyy";
window.close();
}
</script>
<input type="button" onclick="doIt()">



0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
reflections, dynamic class loading 3 70
WebLogic 12c - "Unexpected CryptoAPI failure" 9 378
Java Email Transport Not working 14 104
Using Tomcat as raspberry pi java app server 13 166
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…
Verbose logging is used to diagnose garbage collector problems. By default, -verbose:gc output is written to either native_stderr.log or native_stdout.log.   It is also possible to redirect the logs to a user-specified file. This article will de…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

810 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