- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2016 05:03 PM
I have a glideAjax on UI action (List Choice). Lets say, addInfoMessage is added from the server-side, its gone when I referesh the list, irrespective of before or after the ajax call. If I return the message to ajax call, g_list doesnt have addInfoMessage, how could I display it. Any help is much appreciated. Below is my code snippet.
function onClickFunctionName() {
var selSysIds = g_list.getChecked();
g_list.setFilterAndRefresh("");
var ga = new GlideAjax('scriptName');
ga.addParam('sysparm_name', 'funName');
ga.addParam('sysparm_sys_id', selSysIds);
ga.addParam('sysparm_show_msg', false);
ga.getXMLAnswer(function(response){
//GlideList2.get("tableName").setFilterAndRefresh("");
});
}
Thanks,
Medha
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2016 11:48 AM
Hi Medha,
Try using the below function. It should work.
The first parameter is the message.
addFormMessage("Testing", "info", 0) // for info
addFormMessage("Testing", "error", 0) // for error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2016 12:22 PM
I see from your code that you are making the ajax call post the list refresh. You can run the above function on the response of ajax call. Let me know if that works. Or if that doest work pls post the recent changed code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2016 02:21 PM
Yes, I have tried that approach too, refreshing with in the response, still the same issue. Below is the edited code:
function onClickFunctionName() {
var selSysIds = g_list.getChecked();
var ga = new GlideAjax('scriptName');
ga.addParam('sysparm_name', 'funName');
ga.addParam('sysparm_sys_id', selSysIds);
ga.addParam('sysparm_show_msg', false);
ga.getXMLAnswer(function(response){
GlideList2.get("tableName").setFilterAndRefresh("");
addFormMessage(response, "info", 0);
});
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2016 03:54 PM
Hi Medha,
I am not aware of any handle that glist provides for a callback after refresh. Essentially it refreshes the frame itself. So one way to do is to reload the frame instead of refreshing the list and add a onload event using addLoadEvent function and call the addFormMessage.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2017 10:17 AM
A handy page is given below. So in your ajax response you can call the dialog window.
https://www.servicenowguru.com/system-ui/glidedialogwindow-advanced-popups-ui-pages/