cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Type Ahead or Auto Suggest for textbox controls in XUI

TomLeoboldt
1-Newbie

Type Ahead or Auto Suggest for textbox controls in XUI

We are developing some new XUI dialogs that include numerous textbox controls. Some of those textbox controls have restricted lists of valid values that may be entered by the user. Because some of the lists of valid values are extremely long (several hundered values), we are seeking to implement logic that will capture the initial letters typed by the user and then auto-complete the entry when the data typed by the user matches one of the values in the list of valid values. A common example of the type of behavior we are looking for can be found in search field of Google.


Has anyone implemented this type of behavior for a <textbox inxui=" and=" would=" youbewilling=" to=" share=" your=" solution?=" we=" assume=" this=" solution=" would=" be=" implemented=" in=" javascript=" in=" the=" xui=" dialog,=" but=" are=" open=" to=" suggetions<=" p=">

Regards, Tom.

1 REPLY 1

Hi Tom--



I'd recommend trying a <combobox> with type="simple" and sorted="true".
Then, add a <listitem> child for each of the valid values. When the user
starts typing a value, the list of choices shown will scroll to the
item(s) that start with whatever they user has typed.



The downside is that this configuration won't prevent a user from
entering a value that's not valid. You might have to add some
post-process checking (e.g. a focusout event listener) for invalid
values or something along those lines.



You could certainly develop the kind of customization you describe, but
it would require a bit more custom programming. The approach outlined
above gets you something similar with very little custom code.



--Clay



Clay Helberg

Senior Consultant



TerraXML

1380 Forest Park Circle, Suite 100

Lafayette, CO 80027
Top Tags