[IGN-6521]Unable to Search Through Vision Dropdown Component with Keystrokes

The searchable dropdown component that was originally prototyped here has been further developed and published on the exchange:

Features that have been added that were not present in the original prototype:

  • Added support for all datatypes
  • Restructured code to populate and function properly no matter how many columns are present
  • Corrected focus issue that could delete the first letter when typing
  • Improved data validation to reset selected index and values if edited text no longer matches a dropdown selection
  • Added clearTextOnClick option so the clear text field on click is optional
  • Set minimum dropdown menu width to width of the dropdown component
  • Added autocomplete option
  • Added up/down arrow, page up/down, escape, and enter key functionality within the dropdown menu itself
  • Refactored code so the dropdown menu component is not recreated every time the user types
  • Added mouse listener to highlight dropdown item on hover
  • Added custom properties to change selected row foreground/background colors
  • Added preview selection function
  • Added auto resize option to automatically remove whitespace in dropdown menu when the list is shortened by filtering

Version 2.02 Improvements:
• Changed the way strings are handled, so special Unicode characters and Unicode characters from other languages can now be displayed and searched for in the dropdown. Example: áéíóúÁÉÍÓÚñÑ
• Corrected a bug that appeared when there is only a single column of string data, so the selected value does not become the row index of the filtered data rather than the selected index of the entire dataset
• Refactored code adding a setSelectedValues custom method to eliminate a point of redundancy that was discovered
• Added automatic integer conversion to string values in the value column if the string values are numeric
• Added a selectedStringValue property, so that unconvertable non-numeric value column selections can be represented by a externally accessible property

Version 2.03 Improvements:
(Improvements based on user feedback and implementations)
• When writing to the selected index, label, value, or string value properties, the system will automatically update all relevant elements, assuming that the provided information is a valid member of the dataset. If the information is not valid, the attempted write operation will be removed.
Example: Writing a value of 6 to the selectedIndex property will automatically update the selectedLabel, selectedValue, selectedStringValue, and the actual text that is typed in the dropdown (if there is an entry at index 6 in the primary dataset).

• While typing, the moment the text matches a label in the dataset, the selected label and associated properties will update accordingly without the need for further input.
• In previous versions, changing the data in the designer while not in preview mode could result in either an index out of bounds exception at run time or the selected value being displayed in the textfield instead of the selected label. This could only happen if the number of columns changed to less than two or to greater than one. The list click listener was updated, so it determines the label index at the mouse click event instead of at its initialization.
• Refactored and corrected regression in passFocus custom method that allowed the dropdown button to gain focus when tabbing
• Added keyPressed and keyReleased custom properties that receive the keyCode from the text field's keyPressed and keyReleased events. They will fire a propertyChange event every time a key is pressed or released making it possible to do custom key event scripting from a specific template instance without having to add a listener at run time
• Added clearSelectionsOnDataChange option that makes clearing the selected values, label, and text optional any time that the dataset for the dropdown is replaced via binding or scripting. In other words, if this option is deslected, and the Data property for the dropdown is updated, the selected label, values, and index will properties at the time of the update will remain unchanged
• Dropdown font matches the textfield font, and automatically scales with the the textfield font when the searchable dropdown component is resized.
• Added the option to highlight text automatically on focus gained

5 Likes