Gossamer Forum
Home : Products : DBMan : Customization :

popup add record

Quote Reply
popup add record
I am creating a database that shows who is present at an event. Since many people will be assigned to log people into the event, and you (as a user) would want to see the list of people present, I set a refresh metatag for 60 seconds to keep pulling the display of people logged in. No problem there.

Now when I add a record or edit a record, I want to use a popup window. When you are done editing the record and save it, I'll make the popup close... that's no problem either. The way I do this is to set a meta refresh to 0 seconds using the html add_success sub and direct the page to a page I have on the server called close.html . The result is that the add success result is shown for a fraction of a second and the whole window just goes away.

The problem is how do I make the popup window cause the parent window to refresh. I'm sure there's some javascript trick that will do this. What I think is that if I know the name of the parent window I can send a refresh command to it.... question is, does anyone know how exactly to do this?

Wes
Quote Reply
Re: [kd4rdb] popup add record In reply to
I like this. I'm always amazed at the way people hack dbman. This sounds like something I'd do.

I think you want onbeforeunload in the pop-up page that would be <body onbeforeunload="someFunction();"> and that function would be window.opener.something or window.parent.something. Of course the "something" is the part I don't know.

Try posting to www.webdeveloper.com if you don't get an answer here. They have a really good JavaScript support forum.

Good Luck!

Ps: If you don't get a response here, please post back with the answer you get elsewhere.

My hack would be to set a value in the "parent window" upon closing the pop-up and then have a timer that would check if the value is true and then refresh page if so.
Quote Reply
Re: [Watts] popup add record In reply to
See attached examples.

timer.htm opens window.htm which when closed, refreshes timer.htm

(view source to get the idea) - this is really rough but it works for me. Sorry for the sloppiness but I did it between stuff at work and didn't have a lot of time to make it pretty. Hope you can get it to work for you.
.

Last edited by:

Watts: Dec 11, 2006, 10:19 AM
Quote Reply
Re: [Watts] popup add record In reply to
Thanks!! This is ideal!!! This will make my data entry so much smoother.

I agree with what you said about all the ways DBman can be changed... the thing is, it's the people here in thiis forum that are the true power behind dbman.

Wes