- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2015 07:49 AM
Hello.
I have built a client list UI Action designed as List Choice. This action takes the checked rows and sends them via GlideAJAX to server. Server processes them and sends back a result. I want to refresh the list after the reply (result) arrives back to client, but am unable to do so. The script I am trying to use is:
function send() {
var checked = g_list.getChecked();
var sendGA = new GlideAjax('script_include_name');
sendGA.addParam('sysparm_name', 'method_name');
sendGA.addParam('sysparm_ids', checked);
sendGA.getXML(parseResponse);
}
function parseResponse(response) {
g_list.refresh();
}
The problem is, the list does not refresh. It does if I put the refresh() method call to the 'send' function, but I want to refresh the list only after I get the response from server, so that the changes will be visible on refresh.
I am using Fuji Patch 4 and developing a scoped application.
Thank you very much.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2015 12:48 PM
I did this:
GlideList2.get(g_form.getTableName() + '.incident.parent').setFilterAndRefresh('');
function continueOK(){
//Get the selected values from the right slushbucket
var values = slush.getValues(slush.getRightSelect());
//Get the sys_id of the current record
var taskID = g_form.getUniqueValue();
if(values == ''){
alert("At least one must be selected");
return;
}
//Update the incident records
var ajax = new GlideAjax('Ajax');
ajax.addParam('sysparm_name', 'ajaxFunction');
ajax.addParam('sysparm_taskID', taskID);
ajax.addParam('sysparm_values', values);
ajax.getXML(addAjaxResponse);
GlideList2.get(g_form.getTableName() + '.incident.parent').setFilterAndRefresh('');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2015 12:48 PM
I did this:
GlideList2.get(g_form.getTableName() + '.incident.parent').setFilterAndRefresh('');
function continueOK(){
//Get the selected values from the right slushbucket
var values = slush.getValues(slush.getRightSelect());
//Get the sys_id of the current record
var taskID = g_form.getUniqueValue();
if(values == ''){
alert("At least one must be selected");
return;
}
//Update the incident records
var ajax = new GlideAjax('Ajax');
ajax.addParam('sysparm_name', 'ajaxFunction');
ajax.addParam('sysparm_taskID', taskID);
ajax.addParam('sysparm_values', values);
ajax.getXML(addAjaxResponse);
GlideList2.get(g_form.getTableName() + '.incident.parent').setFilterAndRefresh('');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2015 12:25 AM
Thank you very much Mike, this works great! I just had to hardcode the table name, as g_form seems unavailable on lists, but that is not a problem.