Solved

Results from child modal window not populating the parent window

Posted on 2004-09-29
3
413 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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

-Xmx and -Xms are the two JVM options often used to tune JVM heap size.   Here are some common mistakes made when using them:   Assume BigApp is a java class file for the below examples. 1.         Missing m, M, g or G at the end …
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…
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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

8 Experts available now in Live!

Get 1:1 Help Now