
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2015 02:51 AM
I'm trying to implement a loading pop up using both the GlideDialogWindow & the ShowLoadingDialog as below...
showLoadingDialog();
var loadingDialog = new GlideDialogWindow("dialog_loading", true);
loadingDialog.setTitle('Loading CIs please wait');
loadingDialog.render();
// Then later in the client script ...
addLateLoadEvent(function(){
hideLoadingDialog();
loadingDialog.destroy();
});
The GlideDialogWindow() works in firefox but neither work in IE or Chrome (this was the reason for adding the showLoadingDialog())
Has anyone else experienced this and found a work around?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2015 11:17 AM
Browser engines loads the pages in different orders and execute onload client script differently. It is better to use a flag to hide difference and check for that flag. Here is a sample:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2015 12:07 AM
Hi David,
It is is typo actually. That is the flag I was referring in the description "loadingFlag" is actually "loadingFlag".
The above script was just to enhance the script provided in the description. There is another way, You can simply create and use a formatter "Creating a Formatter - ServiceNow Wiki" like below. You will add the formatter to your form that you would like to have the loading popup. Putting it upper in the form layout the better. Once the below UI macro is trigger while the form rendering it will popup a loading window and once the form is loaded it will be destroyed. Please note that it is still depends on how the browser javascript engine works. It is better to be test every browser to be sure that works.
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate var="jvar_show_dialog" expression="!RP.isPopup()" />
<j:if test="${jvar_show_dialog}" >
<script>
//Show the loading dialog immediately as the form loads
showLoadingDialog();
//Wait until the form has finished loading
addAfterPageLoadedEvent(function(){
hideLoadingDialog();
});
</script>
</j:if>
</j:jelly>
Regards,
Hakan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2015 06:28 AM
Hello Hakan,
I have figured out that flag typo however the example you provided on your comment does not work in Fuji. I have been trying to adapt what you proposed up above with part of the one you mentioned on your last comment. So far is working fine with all the browsers but the problem is that in Fuji it needs to call a UI Page and cannot execute " showLoadingDialog();" since it is not recognize at that point. what I do not like is that it is showing 2 dialogs, the loading one plus the UI page I created. Thanks!
Regards,