AndreasB
Posts: 9
|
| Posted: 11/11/2004, 3:21 PM |
|
Hi,
i'm trying to convert my existing detail pages to popup windows.
Getting the popup to work was quite easy, but i'd like to refresh the opener page as soon as the form is submitted in any way and then close the popup window (i.e. javascript: opener.location.reload();window.close()).
I have tried to add similar code to the Client on submit action of the regarding detail form. The effect was quite strange. Sometimes it works as expected, sometimes the database records do not get modified at all...
Many Thanks in Advance.....
Andreas.
|
 |
 |
DonB
|
| Posted: 11/11/2004, 6:26 PM |
|
It's a timing thing. You are trying to do a submit AND tell the other page
to fetch the data you are submitting. Sometimes they execute A then B,
other times the order is B then A.
--
DonB
http://www.gotodon.com/ccbth
"AndreasB" <AndreasB@forum.codecharge> wrote in message
news:24193f3fa00b96@news.codecharge.com...
> Hi,
>
> i'm trying to convert my existing detail pages to popup windows.
> Getting the popup to work was quite easy, but i'd like to refresh the
opener
> page as soon as the form is submitted in any way and then close the popup
> window (i.e. javascript: opener.location.reload();window.close()).
>
> I have tried to add similar code to the Client on submit action of the
> regarding detail form. The effect was quite strange. Sometimes it works as
> expected, sometimes the database records do not get modified at all...
>
> Many Thanks in Advance.....
>
> Andreas.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
AndreasB
Posts: 9
|
| Posted: 11/12/2004, 12:23 AM |
|
Quote DonB:
It's a timing thing. You are trying to do a submit AND tell the other page
to fetch the data you are submitting. Sometimes they execute A then B,
other times the order is B then A.
Thanks for your answer, DonB.
Is there a solution for this problem? When would be the right timing for such an event??
Thanks,
Andreas.
|
 |
 |
peterr
Posts: 5971
|
| Posted: 11/12/2004, 3:49 PM |
|
Maybe wait a bit until you close the window: setTimeout(window.close(),200);
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
Tuong Do
|
| Posted: 11/14/2004, 3:50 PM |
|
The solution to this is
Create a dummy page call "closeandrefresh" and the page refresh its parent
page then close itseft after that
To do that
in the client onload of the page
window.opener.focus();
window.opener.location.reload();
window.close();
Redirect your details page to this closeandrefresh page
"AndreasB" <AndreasB@forum.codecharge> wrote in message
news:24193f3fa00b96@news.codecharge.com...
> Hi,
>
> i'm trying to convert my existing detail pages to popup windows.
> Getting the popup to work was quite easy, but i'd like to refresh the
> opener
> page as soon as the form is submitted in any way and then close the popup
> window (i.e. javascript: opener.location.reload();window.close()).
>
> I have tried to add similar code to the Client on submit action of the
> regarding detail form. The effect was quite strange. Sometimes it works as
> expected, sometimes the database records do not get modified at all...
>
> Many Thanks in Advance.....
>
> Andreas.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
AndreasB
Posts: 9
|
| Posted: 11/16/2004, 3:29 AM |
|
peterr:
i'm afraid this solution was not quite sufficent as it was hard to estimate how long the DB update would take, since the database resides on a different Server than the site. but thanks anyway.
Tuong Do:
Thanks alot... this works just fine. I can only recomend this solution.
Thanks,
Andreas
|
 |
 |
|