Frankie G
Frankie G

Reputation: 91

Auto update data onFocus without refresh

I have a webpage for that allows the user to add attachments (stored in a directory) For this I use a greybox to popup a window and there the user can view add or delete docs as they see fit, this all works fine.

The problem I have is that when the user closes the popup the total of attachments which is displayed on the main page isn't updated and requires a refresh, which I want to avoid. I would like to have this data automatically update preferably when the focus changes back to the main page. I'm on Solaris so I can get the total of files easily its just the display update I need.

All help appreciated

Frankie

Upvotes: 0

Views: 174

Answers (1)

Roozbeh Zabihollahi
Roozbeh Zabihollahi

Reputation: 7347

In such situations I prefer to handle onPopupClose instead of onFocusChange. After a little search, apparently greybox let you do that by defining a callback function (described here):

GB_show(caption, url, /*optional*/ height, width, callback_fn) 

So you may write something like this:

GB_show('Popup', 'popup_url', 500, 500, function() {
    updateTotalAttachmentCount();
}); 

Upvotes: 1

Related Questions