Uncaught TypeError: Cannot read property 'scrollTop' of null

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2016 08:36 AM
So, in Eureka, this code works fine:
function close_and_reopen_UI_Page()
{
// Close this current pop-up UI page
GlideDialogWindow.get().destroy();
// Re-open this UI pop-up page again, but now showing updated info
var dialog = new GlideDialogWindow('bcp_BCC_Author_EDIT');
dialog.render();
}
However, in Geneva, when it hits line 8, dialog.render(), my web browser stays in a permanent .5 opacity mode and looking in console log, I see:
Which upon inspection shows:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2016 11:26 AM
Well, I found out how to fix the issue, but I can't figure out why it has to be done this way:
var UI_reload_Timer = 0;
function reopenUI()
{
clearInterval(UI_reload_Timer);
var dialog = new GlideDialogWindow('bcp_BCC_Author_EDIT');
dialog.render();
}
function close_and_reopen_UI_Page()
{
UI_reload_Timer = setInterval(function(){ reopenUI(); }, 500);
// Close this current pop-up UI page
GlideDialogWindow.get().destroy();
// Re-open this UI pop-up page again, but now showing updated info
var dialog = new GlideDialogWindow('bcp_BCC_Author_EDIT');
dialog.render();
}
Why do I need to set a delay to re-open the dialog window?