Forums

This topic is locked

Refresh on set focus

Posted 30 Sep 2002 11:29:51
1
has voted
30 Sep 2002 11:29:51 Julio Taylor posted:
hey

i'm trying to get my page to refresh whenever the user sets focus on it. i have a popup window which deletes a record, and i want the user to be able to see the changes he made when he closes the popup and goes back to the original page... i know i need to use JS but don't really know how. any ideas?

thanks!

Replies

Replied 30 Sep 2002 12:54:04
30 Sep 2002 12:54:04 Vince Baker replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I had to do the very same thing except after an update last week. I found and used this code, works well.

&lt;a href="javascript:;" onclick="opener.location='Main_page_to_Refresh_URL'"&gt;Close&lt;/a&gt;


Regards
Vince

Response.write("The best line of code you can ever use"

VBScript | ASP | HTML | SQL | Oracle | Hosting
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Regards
Vince

Response.write("The best line of code you can ever use"

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 30 Sep 2002 13:33:07
30 Sep 2002 13:33:07 Dave Thomas replied:
This may also help, I found it in my snippets book.

Question:

Is it possible to close the advanced popup window on the submission of a form, and have the page it was called from refresh, to display the results just submitted?

Answer:

make a RedirectChildWindow.htm file containing:

&lt;script language="JavaScript"&gt;
&lt;!--
function refreshParent() {
window.opener.location.href = window.opener.location.href;
if (window.opener.progressWindow)
window.opener.progressWindow.close();
window.close();
}
//--&gt;
&lt;/script&gt;

body onLoad="refreshParent()"


2. Put this file in the popup window as a redirect at your Insert/Update record SB



Regards,
Dave

UD4 || Flash || Access ||Web Hosting
Replied 30 Sep 2002 16:15:46
30 Sep 2002 16:15:46 Owen Eastwick replied:
I had to do something similar, I'm not really much of a JavaScript guru but here's what I came up with:

&lt;% If Request.QueryString("Complete" = 1 Then %&gt;
&lt;img src="AEinterface/Spacer.gif" width="1" height="1" onLoad="window.opener.location='BuyViewRFQs.asp?selFilter=&lt;%= varFilter %&gt;&selSort=&lt;%= varSort %&gt;&offset=&lt;%= varOffset %&gt;'"&gt;
&lt;% End If %&gt;

First I was inserting a record from my pop-up page so when this was done I used a Response.Redirect to return to the same page with the URL parameter Complete=1 so that I could display a "Record Inserted" message, I also used this for a conditional region around a transparent .gif image.

Then I used an onload event with the transparent gif to navigate the parent window to a specific page:

onLoad="window.opener.location='BuyViewRFQs.asp?selFilter=&lt;%= varFilter %&gt;&selSort=&lt;%= varSort %&gt;&offset=&lt;%= varOffset %&gt;

My parent window was a sorted list of records, so I had to preserve all the URL parameters selFilter, selSort and offset in order to Navigate the parent window back to the exact same position in the list.

Because the parent window was a sorted list I couldn't use window.refresh because it would produce an alert box on the parent windw that would potentially confuse the user. You may be able to use something like:

onLoad="window.opener.refresh" (I'm not sure of the exact syntax, I'm a bit hit and miss with JavaScript)

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo

Reply to this topic