Forums

Find answers, ask questions, and connect with our
community all around the world.

Home Forum Omnis General Forum Type Ahead

  • Type Ahead

    Posted by Paul Mulroney on June 16, 2022 at 12:57 am

    Hi $All,

    Ben Weinberg asks this question on the Omnis list, but I thought it would be good to ask here too:

    Is there a new and less complex method of implementing a type-ahead entry field than the one from Studiotips? I have used that version for years and it works well, just has a lot of ‘overhead’.

    We’re looking at implementing this in our system, if there’s a new way to do this we’re interested in knowing how!

    Regards,

    Paul.

    Paul Mulroney replied 2 years ago 2 Members · 2 Replies
  • 2 Replies
  • Gav

    Member
    June 16, 2022 at 1:33 pm

    Hi Paul,

    I don’t know the Studiotips solution to type-ahead, so can’t comment on that. However, if you are looking to perform type-ahead searching against a SQL database, then I imagine a SQL Worker object could be used.

    You would instantiate and initialise the worker object and $start it with the first character(s) in the query. Have $keyevents turned on for your entry field and upon a key event, immediately $cancel the worker task and $start with the new entry string.

    This is just an idea and not something I’ve personally used yet. How the performance pans out would depend on the amount of data in the table your users are querying, whether the query uses an index on the queried column, and how many lines (i.e. how much data) are returned from a typical type-ahead query.

    It could potentially lead to a fairly slow user experience where they see nothing returned until they stop typing for long enough to allow the worker object to complete and return some results. Therefore, it might be an idea to have two worker objects, allowing one to continue running while you start the other? You might also want to limit the number of rows returned by this background process (select top 10….from <tablename>…) and only return a larger dataset if this completes and no further key events have been detected.

    As I say, this is thinking out loud. Hope it gives you some ideas.

    Rgds,
    Gav

  • Paul Mulroney

    Member
    June 24, 2022 at 12:42 am

    Thanks Gav, that sounds like a great idea!

Log in to reply.