Solved

Refresh form and close window

Posted on 2003-11-20
9
1,660 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
netstat -a in AIX unix 8 47
HTML5 vs JSP - REST based application development 4 1,187
spring example errors 33 401
going to wrong jsp page 2 33
Are client relationship the only driver of a successful MSP? While important, client relationships are only one component. Learn how else MSPs can broaden their horizon and differentiate themselves.
Giving access to ESXi shell console is always an issue for IT departments to other Teams, or Projects. We need to find a way so that teams can use ESXTOP for their POCs, or tests without giving them the access to ESXi host shell console with a root …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

791 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