Set Selected In AW.UI.Combo
I am using a "standalone" AW.UI.Combo().
Assuming I know which item I want to default the combo to, how does one do that? Here's a snippet of the ASP code I am using and which doesn't work. The combo remains blank. setSelectedItems([<%=po_num%>]) doesn't seem to set the combo to a specific item. (po_num, obviously, would be the variable that contains the index to have as selected.)
Help?
Assuming I know which item I want to default the combo to, how does one do that? Here's a snippet of the ASP code I am using and which doesn't work. The combo remains blank. setSelectedItems([<%=po_num%>]) doesn't seem to set the combo to a specific item. (po_num, obviously, would be the variable that contains the index to have as selected.)
Help?
var postalCombo = new AW.UI.Combo();
postalCombo.setId("postalCombo");
postalCombo.setItemCount(myPOVals.length);
postalCombo.setItemText(myPOVals);
postalCombo.setItemValue(myPOKeys);
<% If po_def > 0 Then %>
postalCombo.setSelectedItems([<%=po_num%>]);
<% End If %>
// make combo more <select>-like
postalCombo.getContent("box/text").setAttribute("readonly", true);
postalCombo.onControlEditStarted = function() {
this.getContent("box/text").element().contentEditable = false;
}
postalCombo.onControlValidated = function(){
alert(this.getSelectedItems());
alert(this.getItemValue(this.getSelectedItems()));
}
document.write(postalCombo);
Paul Tiseo
June 30,