Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Refresh form and close window

Posted on 2003-11-20
9
Medium Priority
?
1,676 Views
Last Modified: 2008-02-01
hi,
  I have a form called menu.jsp that needs to be refreshed after data gets inserted.

It is like this:
when the user clicks the add button, a pop-up window pops(adminupdate.jsp) to allow user to enter data and the data is sent to trial.jsp.

So, trial.jsp window needs to be closed with menu.jsp be refreshed.

thansk
0
Comment
Question by:Jasbir21
[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
9 Comments
 
LVL 18

Expert Comment

by:bobbit31
ID: 9789239
in trial.jsp (assuming this is loaded in the popup window)

<script language=javascript>
   window.opener.reload();  
   window.self.close();
</script>
0
 

Author Comment

by:Jasbir21
ID: 9791792
hi,
  previously , i did put replace or reload when adminupdate.jsp is a pop-up window, the problem is adminupdate.jsp which is a pop-up window submits to trial.jsp . menu.jsp needs to be refreshed
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9791944
does bobbit31's javascript not work?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:Jasbir21
ID: 9792011
hi,
... it doesn't .

thanks
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9793347
You should put the javascript in the trail.jsp after update/insert success.
if still doesn't work, try:
window.opener.location.reload();
0
 
LVL 1

Accepted Solution

by:
yapsing earned 800 total points
ID: 9794698
after insert/update place the following
<script>

function startTime(){
        var time= new Date();
        hours= time.getHours();
        mins= time.getMinutes();
        secs= time.getSeconds();
        closeTime=hours*3600+mins*60+secs;
        closeTime+=1;  // This number is how long the window stays open
        Timer();
}

function Timer(){
        var time= new Date();
        hours= time.getHours();
        mins= time.getMinutes();
        secs= time.getSeconds();
        curTime=hours*3600+mins*60+secs
        if (curTime>=closeTime){
                self.close();}
        else{
                window.setTimeout("Timer()",1000)}
}
</script>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#999999" onLoad="startTime();" onUnload="opener.location.reload(1)">
0
 
LVL 6

Expert Comment

by:jarasa
ID: 9795964
Hi.
You should try to submit trial.jsp from menu.jsp instead of adminupdate.jsp. Just place a hidden form on menu.jsp with all the fields of adminupdate.jsp and when you click submit,  call a javascript function in menu.jsp wich copies the data from adminupdate.jsp and closes it, then submit the hidden form to trial.jsp, on trail.jsp redirect to menu.jsp and "voala" you have menu.jsp refreshed.
Have Fun
Javier
0
 

Author Comment

by:Jasbir21
ID: 9796514
Thanks for the help..

0
 

Expert Comment

by:aashtee
ID: 10347460
How do you not make a pop up page and yet do the same thing.

I want to display a table of data from database (dynamically by calling a bean) and make one of the fields of each row as a link t open more details ..... which has to be in the same page.

3 questions:

how to keep track of where the user is in the hierarchy and which part of which record is he trying to see details for .

how to create the dynamic links to create and send the query for that record, open a page afterthat and display the result of the query.

how to return to same page after user is done viewing by "cancel" or "ok"

I am new at this and am sorry of it is a trivial question but i could not find a reply on the website.

regards,
Aashtee.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

In this article, WatchGuard's Director of Security Strategy and Research Teri Radichel, takes a look at insider threats, the risk they can pose to your organization, and the best ways to defend against them.
What we learned in Webroot's webinar on multi-vector protection.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

718 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