Page 1 of 1

Textbox onDataChange not Detecting character changes

PostPosted: Wed Mar 29, 2023 4:42 pm
by ryan1680098789
I'm working on developing a form with a textbox that has a custom drop down to display records. As the user types in the textbox, the drop down will be auto searching the records in the drop down with the string the user is typing. The on data change for textbox's only detected a data change on focus loss or if the user presses enter. I know that the typeahead component has this functionality of displaying a value list, and as the user types it will sort/search the list for every character change that occurs. Normally I would use a typeahead but because I need a custom drop down I cannot use it. So I am wondering if there is a way to detect character changes on a textbox?

Re: Textbox onDataChange not Detecting character changes

PostPosted: Thu Mar 30, 2023 3:57 pm
by steve1376656734
Why not use a typeahead with a custom valuelist that has a global method. That way, whatever function you are currently using to construct the dropdown items can be used to return the custom valuelist items. Takes away all the hassle of having to create your own dropdown:
Custom_valuelist_global_method.png
Custom_valuelist_global_method.png (36.9 KiB) Viewed 1586 times

As the user types, the global method will be called with the currently typed value and you can return the filtered list accordingly.

Re: Textbox onDataChange not Detecting character changes

PostPosted: Thu Mar 30, 2023 4:47 pm
by ryan1680098789
I've tried a custom value list but the custom value list doesn't account for the fact that I need to add some extra components that are needed to be seen in the drop down (i.e. showing a few buttons in the drop down), hence the custom drop down.

Re: Textbox onDataChange not Detecting character changes

PostPosted: Thu Mar 30, 2023 4:53 pm
by steve1376656734
Then the only other thing I can suggest is to add a keylistener to the textbox and use that to capture individual keystroke changes and manipulate the dropdown from there.

Re: Textbox onDataChange not Detecting character changes

PostPosted: Thu Mar 30, 2023 4:56 pm
by ryan1680098789
That's a good idea, I forgot about that......Thank you for your suggestion!