Editable selectedboxedbox property does not update the user interface
Using javascript I am trying to change the selection of a list item this way:
function selectFirstActiveListItem(oListBox)
{
for (var i = 0; i < oListBox.options.length; i++)
{
oListBox.selectedIndex = i;
var szStatus = GetDomboBoxItemAttribute("Status", m_pdocConnectType.getXMLDOM(), oListBox);
if ("Enabled" == szStatus)
return;
}
oListBox.selectedIndex = 0;
}
Although the index changes correctly in the background, it is not reflected in the UI. The old selection is still displayed in the list.
What will go wrong?
+2
Manav sharma
source
to share
2 answers
Oops! This worked and showed the correct result. This is where I was wrong.
0
Manav sharma
source
to share
try this instead:
oListBox.options[i].selected = true;
+3
spudly
source
to share