Custom Text Data Change with Type Ahead?

By default it seems that the Type Ahead element allows for the user to ONLY select text that is within a dataprovider already, aka select only options from the drop down. Is it possible to enter in custom text as well? As in, a datachange of that record.

You know, like how a Google search has both a type ahead AND allows you to put whatever text you want.

Hi John,

It depends on the type of ValueList being used.
If the display value and the real value are the same, then you can just capture the input in the onDataChange.

However, it is common that the datatype is often different, i.e.
Dog|1
Cat|2
Mouse|3

The the TypeAhead will not accept input for values that don’t fall within the list.
For this case you can use a Global Method Value List. This is quite a bit more work, as you determine by keystrokes what the display and real value should be, but you have full control.

A 3rd option could be that you add a list item which indicates a response designated for more action. i.e.
Dog|1
Cat|2
Mouse|3
Other…|4

Then trap it on data change to check it

Hope this helps.

Best,
Sean

Thanks Sean for the reply, but I was curious about this point.

The the TypeAhead will not accept input for values that don’t fall within the list.
For this case you can use a Global Method Value List. This is quite a bit more work, as you determine by keystrokes what the display and real value should be, but you have full control.

What do you mean by ‘Global Method Value list’? The reason I ask is because if there was a way to make a singular global method to change ANY type aheads into the typeahead/textbox hybrid that would be great.

Hi John,

I meant the type of the valuelist is global method (i.e. custom, global method, table, related)
Don’t think it is possible to have a global way to accept new values into valuelists / type ahead.

The most common approach is what I shared before, inject a value into your list which is something like “Add new item…” then handle the data change to intercept it.

You could file a feature request, it’s not a bad idea, but that might be tricky to get right w/o affecting many other API and events of components and data. We could take a look.