Reputation: 3479
I have three pages
I'm creating form on main page, for some operations is admin key needed, so popup window is opened by button. When popup window is filled, submitted and key is found in database, popup window is redirected to foo page and it is closed. So I'm back on main page and I need it automatically refresh to take the changes.
I can't do it using by onclick="window.opener.location.href='main.xhtml';
on button because its too quick a there is time delay to find key in database.
Do you have any suggestion?
Upvotes: 2
Views: 5037
Reputation: 29381
How do you close it? Are you injecting JavaScript after the postback?
Add a function that refreshes the opener;
window.onbeforeunload = function() {
window.opener.reload(true);
};
window.close();
Untested.
BalusC is probably right in his comment, it would be sufficient with
window.opener.reload(true);
window.close();
Upvotes: 3