Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi all,
I was building a listbox that I used the sort=true. The listbox is sorted fine, BUT when you select an item in the listbox to use it doesn't pass back the correct item. One of my experiments I selected the item and then displayed information in the next listbox. When the listbox was sorted and I picked the 6th item it returned the information of the 6th item of the non-sorted listbox.
Has anyone seen this before? Do other people use the sort attribute? I didn't see anything in the archives.
Thanks,
Ellen
Arbortext 5.2M020 is being used and Javascript is being called from the dailog box.
/* ********************************************************************
* Function for getting the selected items in a Combo Box
* ********************************************************************
*/
function selectedItems(list)
{
var listboxElem = dialogDoc.getElementById(list +"ComboBox").getElementsByAttribute("selected","true", 1);
var selectedListItemsID = [];
var i; /* local index vars */
for (i=0; i < listboxElem.length; i++)
{
selectedListItemsID[i] = listboxElem.item(i).getAttribute("id");
}
return selectedListItemsID;
}
So the returned array should have the list of ids selected. Then I use it like below, the ids are unique so I can use them as keys to get other data.
var selectedFIR = selectedItems("FIR");
var idProvince = selectedFIR[i].slice(2);
metaProvinceNode = activeDoc.getElementsByAttribute("value", idProvince, 1);