Does anyone have a solution for this problem? The answered code does not work for me.
I have a list binded to a datasource that gets requeried, which removes my selection from the list. I am trying to save the index of the selection on the list before it is refreshed so I can reselect it after the updating my datasource. I have looked in the List.js for the appropriate methods but they aren't working for me.
To grab the index (I am not allowing multiple selections) I have
var indexB = document.getElementById("list2").object.selectionIndexes();
var indexA = document.getElementById("list1").object.selectionIndexes();
Then I perform a query on a datasource that is binded to both lists.
var dataSource = dashcode.getDataSource("model");
dataSource.performQuery();
This causes me to lose the list selections so I am trying to reselect with
document.getElementById("list1").object.setSelectionIndexes(indexA,false);
document.getElementById("list2").object.setSelectionIndexes(indexB,false);
I believe the script executes past all the code but does not make the selections.