Skip to main content
1-Visitor
January 7, 2013
Question

Type Ahead or Auto Suggest for textbox controls in XUI

  • January 7, 2013
  • 1 reply
  • 663 views

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

    18-Opal
    January 7, 2013
    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