Solved

Refresh form and close window

Posted on 2003-11-20
9
1,652 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Use of TCL script on Cisco devices:  - create file and merge it with running configuration to apply configuration changes
For cloud, the “train has left the station” and in the Microsoft ERP & CRM world, that means the next generation of enterprise software from Microsoft is here: Dynamics 365 is Microsoft’s new integrated business solution that unifies CRM and ERP fun…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

758 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