add API 'setSelectedIndex'