Solved

Refresh form and close window

Posted on 2003-11-20
9
1,656 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
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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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 200 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

Gigs: Get Your Project Delivered by an Expert

Select from 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

Suggested Solutions

Title # Comments Views Activity
some methods private some are not 8 210
doubleChar java challenge 7 106
Prevent Firefox page from going to the background when clicking a spreadsheet link 17 69
countXY challenge 28 150
One of the biggest threats facing all high-value targets are APT's.  These threats include sophisticated tactics that "often starts with mapping human organization and collecting intelligence on employees, who are nowadays a weaker link than network…
Learn how the use of a bunch of disparate tools requiring a lot of manual attention led to a series of unfortunate backup events for one company.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

813 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

16 Experts available now in Live!

Get 1:1 Help Now