Checking for form load
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2011 10:57 AM
Is there a way to check if the form is completely loaded and all the UI policies are applied before user takes any action on the page. In one of the instance user is on very slow internet speed so while form is loading he take action and hit submit before the page is completely loaded.
Thanks
Amit
- Labels:
-
Orchestration (ITOM)
-
Service Mapping

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2011 04:49 PM
That is a common problem for ALL websites on the entire Internet. ServiceNow gives us two functions that can help, though. Try using these in conjunction to SHOW or HIDE a loading Dialog that keeps the user from getting trigger happy.
showLoadingDialog();
hideLoadingDialog();
The hardest part here is to determine when to call hideLoadingDialog()...
Remember that UI Policies run in order. Try making a high Order number on it to make sure it runs as the last script. You also have Run Script option on the UI Policy to run code like this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2011 06:10 PM
I have already tried this while loading form these dialogs do not show up.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2011 09:14 AM
How are you trying it? Are you trying it on a PC with a known slow loading issue? It should be the first UI Policy with NO CONDITIONS and Run Scripts with showLoadingDialog() in the execute if true function.
function onCondition() {
showLoadingDialog();
}
Then, on the flipside, have one that will:
function onCondition() {
hideLoadingDialog();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2011 09:45 AM
I just helped Amit with a solution for this. The problem with any client script method is that you have to make sure the loading dialog loads before anything else. I'll post a solution early next week.