There are plenty of issues with your code:
- the query can't return any result since your field has a space in it
- Do you really need an FTSearch to return values and not a sorted view?
- the typeahead -as the name suggest- presents values that match left to right and not somewhere substring. If you need that you need to roll your own typeahead function using Ajax
- The typeahead function doesn't take a parameter, so your
lupkey
doesn't go anywhere. The function needs to return all values and XPages will do the matching - Instead of copying one by one into an array for sorting, copy the returning Vector() into a TreeSet(). This is one line, sorts it and removes duplicates
To get it working check this example based on dojo, previously asked here. You will need the REST control