?
Solved

Results from child modal window not populating the parent window

Posted on 2004-09-29
3
Medium Priority
?
423 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Accepted Solution

by:
damonf earned 2000 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

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

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

This exercise is about for the following scenario: Dmgr and One node with 2 application server. Each application server contains it owns application. Application server name as follows server1 contains app1 server2 contains app1 Prereq…
This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

741 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