How to force a refresh/reload

Okay, this seemed easyin principle but I'm coming up stumped.

Start with a setup program in main browser window.  It's a bunch of buttons getting their color and text from a mysql database table.

Click button to edit it, open a popup window, selecting colr, typing text, etc.  

click submit button to submit form - onsubmit, close popup, run php program to save data to database table.

When done saving data, program calls original setup screen.

Problem is it doesn't redraw becasue it is already open and the save program was called from a different window.  Can't  use opener.location.reload(); because the opup is closed before saving data commences.

How the heck can I call the setup program to show the new changes upon returning from piopup window/save process?

tia
Owen
owenparkerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ZvonkoSystems architectCommented:
You have to do two things:
1.) Give the window that needs a reaload a window name.
Like this:
<script>window.name="optwindow";</script>

2.) Open that window after update in popup response by sending this script as response:
<script>
var oW=window.open("","optwindow");
oW.location.reload(true);
self.close();
</script>

The trick is that window.open() method with an empty URL parameter will NOT change the actual URL nor will it load the target window. It will only fetch the reference to the named window.


0
owenparkerAuthor Commented:
Hi Zvonko

Where/how exactly do I run/load the script in number 2 above?  I figire it's probably evident, but I can't find a place to put it that it will 'work'

Thanks
Owen
0
ZvonkoSystems architectCommented:
"upon returning from piopup window/save process" you respond to the Popup window with the script in 2.)

After click on the Submit button you do NOT close the window but wait for the php response. The php response is ONLY the 2.) script text. The script will refresh the target window and close the popup window.


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Ray PaseurCommented:
Have you considered using an IFRAME?
0
owenparkerAuthor Commented:
Zvonko, I have tried to fiddle with your suggestion but am having problems.  I will detail what I have done and the results tomorrow.  Out of gas tonight.

Ray, I have never used iframes.  Could it give me the desired result?  I'm going to have to rethink this somehow if i can't get this to work.  There are a dozen other instances when I would need this exact same behaviour.  
0
Ray PaseurCommented:
Owen, if it were my application, I would go with the "rethink" strategy.  You don't have to write all that code to deal with pop-up windows (notoriously difficult cross-browser).  Just bring the data together in the setup window.  When someone clicks on a button to edit it, the top of the window is the button you want to edit - they do their edits and the action script saves the data into the data base, then reloads the original setup window.  You can do it all in one PHP script and the results will be a lot cleaner, less reloading, less confusing for the client, etc.

This is by no means the only way to accomplish the objective, but it simplifies the client interface, and I'm always a big fan of that! ~Ray
0
owenparkerAuthor Commented:
I do believe I might be getting caught up in trying to emulate other 'normal' windows apps too closely. I'm going to split the points to close this ticket, but for the record, the question/problem was not satisfactorily solved, but for now, that's... OK

Owen
0
owenparkerAuthor Commented:
Trying another direction...  Question not solved, but attempts worthwhile and advice was worthwhile...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.