I have a list where the change event is set to fire a 'listChanged' function. All is well when I actually click an item in the list to trigger the change. It also works fine if I use the arrow key to move up and down on the list. However, if I make the change in code (like this: dataList.selectedIndex = 1;) the correct list item is selected but the event doesn't fire.
Anyone have any ideas why this is?
The "change" event fires whenever the user interacts with the List to change the selection (mouse clicks, arrow keys, etc). The "valueCommit" event fires when the selection has been changed programmatically.
To maintain the code that listens to 'listChange' events, you can make a little trick. In the code where you programmatically change the selected element you can dispatch a 'listChanged' event.