Ryan Buening
Ryan Buening

Reputation: 1660

Only Allow TypeAhead Values in InputText Field

I'm trying to figure out how to limit a user to TypeAhead values in an InputText field. One thought I had is to run logic onblur that would check the value in the field against acceptable values. My inputText and typeAhead code is below:

            <xp:inputText id="TypeAhead">
                <xp:typeAhead mode="partial" minChars="2" ignoreCase="true">
                    <xp:this.valueList>
                        <![CDATA[#{javascript:db = new Array(@DbName()[0], 'names.nsf');
return @DbColumn(db, "($VIMPeople)", 1)}]]>
                    </xp:this.valueList>
                </xp:typeAhead>
            </xp:inputText>

Thanks in advance for any ideas.

Upvotes: 1

Views: 108

Answers (1)

Lothar Mueller
Lothar Mueller

Reputation: 2528

Have you tried a dojo FilteringSelect? It's like a combination of a combo box and a type ahead edit box. ExtLib comes with an Xpages version of it.

In case you're not familiar with that you might want to take a look here:

https://dojotoolkit.org/reference-guide/1.10/dijit/form/FilteringSelect.html#dijit-form-filteringselect

Upvotes: 2

Related Questions