Clairvoyant data entry function?

I would like to set up a Search function whereby a user could begin typing a Contact’s last name in a search filed, and have a portal or list populate with all of the Contract records that match the search argument as it is being built.
I have done this before in 4D by using the event On Keystroke and building a query to display the results after each keystroke. Is there such an event in Servoy? If not, can you suggest a work-around?

Currently we do not yet support keyEvents, but this will be added to future versions, currently you could onAction on a field to start the search on ‘enter’ key pressed

Thanks for the reply! I will look forward to the additinal event, but, in the meanwhile, could you please elaborate a little bit on your suggestion?

a field with type TEXT_FIELD has an ‘onAction’ Method property triggered when hitting enter.
This can be used to start the search.
Example:
-create a global dataprovider
-place a field based on that global
-create a method:
controller.find()
searchColumn = createdGlobal
controller.search()
-add above method to ‘onAction’ on field

When typing a string and hitting enter a search is performed and results are shown.

This is also demonstrated in the example crm default shipped with the installer (try typing a text in the field under the controller buttons)

Note: it is also possible to do searches like startswith, endswith or contains, see help for details

I asked for something similar a while back calling it “type-ahead”. Initially the idea was very appealing to me but then I started to think of the problems that might occur with a large dataset. Let’s say I have 4000 or 40,000 clients (or more). After each keystroke I have to send a request to the backend, then the backend has to send me a progressively smaller set each time. Eventually (as usual) I mistype and backspace a letter, … then a larger set is returned… This flinging of characters towards the backend and the return of potentially very large datasets with every keystroke could be very expensive. Or am I incorrect?

Understanding that MS Access is not Oracle or SQLAnywhere - I currently have an Access database with type-ahead that has only a few hundred contacts. When the tables are on the local workstation it works barely OK. When type-ahead is done over a LAN it is painful. Trying it over a WAN it is too horrible to contemplate.

TA

I’ve done this in 4D and it was not too bad (at least with a modest sized test file in the 1,000 record magnitude). Their method was to load the found record selection to an array, and then to display the array. As all of this happened on the server side, the performance was decent

The way I solved the Delete and Backspace problem was to trap the backspace and delete keys and delay the search until the next searchable character is keyed.