Ask a Question

Not able to select the item in the combo box

SSharma3
Occasional Contributor

Not able to select the item in the combo box

Hi,

I have one combo box, I am using this logic to select the item in the combo box.

value is the name of the combo box item.

 

Sometimes, the item gets selected. But other times only the first item is getting selected. What can be the possible;e reason for that?

 

for (var index=0;index<reqObj["wItemCount"];index++)
{
if(reqObj["Items"]["Item"](index)["Name"]==value)
reqObj["ClickItem"](index);
}

1 REPLY 1
rraghvani
Trusted Contributor

I think your coding should look like this,

for (var index = 0; index < reqObj["wItemCount"]; index++)
{
    if (reqObj["Items"]["Item"](index)["Name"] == value)
    {
        var objItem = reqObj["Items"]["Item"](index)["Name"];
        objItem["ClickItem"]();
    }
}

 

cancel
Showing results for 
Search instead for 
Did you mean: