I have a combo with load on demand and I refresh via javascript. What I want is the combo to populate items and then go and selected item that matches a value id. So for example:
OlinCA.loadStates =
function
(country, selectedState) {
var
rcbContactState = $find(
"<%= rcbContactState.ClientID %>"
);
rcbContactState.set_text(
"Loading..."
);
rcbContactState.clearSelection();
rcbContactState.requestItems((country +
'~'
+ selectedState),
false
);
rcbContactState.findItemByValue(selectedState).select();
}
As you see I am passing a value to populate the combo by a selected country and then select a matching state. Well every time I call that findItemByValue I get an error because that line fires before the list is populated. I need somehow to have the load request finish first. I tried to select a value via the server side code, but nothing gets selected. What is the way I can do the selection like I need to?