开发者

JSF - base page refresh automatically after close popup window

I have three pages

  1. main page
  2. popup page started from main page using onclick javascript method (consists only input and button)
  3. foo page

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?


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();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜