Solved

Refresh form and close window

Posted on 2003-11-20
9
1,653 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
 

Author Comment

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

thanks
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
communication with a non technical owner 16 101
JSP Popup page 2 108
eclipse problems view not showing all the time 4 87
spring example errors 33 263
In 2017, ransomware will become so virulent and widespread that if you aren’t a victim yourself, you will know someone who is.
With the rapid rise in mobile usage, mobile devices are here to stay and have become an integral part of doing business. Here are 9 great apps for your BYOD environment.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

863 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

21 Experts available now in Live!

Get 1:1 Help Now