Type-Ahead Combo

Mischa mischa at omnislab.com
Thu Mar 19 09:19:13 EDT 2015


Hi Rob,

thanks for joining ;)
I for myself will probably not use the type ahead combo for db searches, but rather with pre-fabricated selection lists like postal codes, country codes or titles. These lists are already stored in the class or even in the object ($userinfo), and maybe should have the ability to learn.

Using the combo for db searches could rise a performance or memory problem (you of course could limit the fetch), but under normal circumstances, when users are searching for e.g. a customer in a db out of hundred thousands, they quite exactly know for whom they are searching and hence would enter a search string and then receive a list of matching candidates - at least this is the way I implemented it in my application until know. I have not thought about a type ahead approach in this matter, though. Maybe worth a try ;)

Best greetings
Mischa


---------------------------------------------------
  T H E   O M N I S   L /\ B     www.omnislab.com
---------------------------------------------------


-----Ursprüngliche Nachricht-----
Von: omnisdev-en-bounces at lists.omnis-dev.com [mailto:omnisdev-en-bounces at lists.omnis-dev.com] Im Auftrag von RM research
Gesendet: Donnerstag, 19. März 2015 12:55
An: OmnisDev List - English
Betreff: Re: Type-Ahead Combo

I’d like to ask a user interface question on this thread.

In the past when I’ve done something like this I expected the user to enter a unique code, or the beginning of a unique code.  The app would process their entry and query the database accordingly.  If the user wanted to search the NAME (not the code) thy could enter N:abc,  or A:abc if they wanted to search on the address field.

This gave the user a choice of what they wanted to apply their search string on.
If you wanted to implement this you would need to wait for a certain number of chars before executing your search, varying on whether the second character was a colon.

The other thing was assuming their text would always be at the beginning of a field… this way my SQL fetch would utilise indexes.  If the *user* wanted to search anywhere they could enter a wildcard character e.g. N:%abc  would search anywhere in the NAME column.

Just my 2 cents worth.  Would this add any value to your application Mischa / Mats / others ?

My concern about search the list of entries is that your list could be huge depending on the context.  A product list could have several thousand records in it.  If that’s fine, its fine, but I would be concerned about lists that size for performance reasons.  I would prefer to ask the db to do the searching.  Context is everything of course!  I’m not saying never search from lists.

Cheers,
Rob

> On Thu19 Mar 2015, at 11:37, Mischa <mischa at omnislab.com> wrote:
> 
> Hi Mats,
> 
> thanks a lot!
> In $validate, why do you discard the event when iv_TEXT='' ?
> The problem with it is, that you cannot leave the field, click behind or close the window as long as you did not enter anything.
> It does not seem to be vital for the functionality(?)
> 
> Ah yes - the correct line for detecting a leading occurrence would be
> Do iSourceList.$filter(upp(pContents)=left(upp(iSourceList.c1),len(pContents)),kTrue)     ;; leading occurrence
> (the one I mentioned in my previous post did not work)
> 
> Many thanks
> Mischa
> 
> ---------------------------------------------------
>  T H E   O M N I S   L /\ B     www.omnislab.com
> ---------------------------------------------------
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: omnisdev-en-bounces at lists.omnis-dev.com [mailto:omnisdev-en-bounces at lists.omnis-dev.com] Im Auftrag von ADJob
> Gesendet: Mittwoch, 18. März 2015 20:08
> An: omnisdev-en at lists.omnis-dev.com
> Betreff: Re: Type-Ahead Combo
> 
> Hi Mischa,
> 
>> On windows, it displays the system classes, regardless which key is entered
>> - is this on purpose?
> 
> Yes. System classes is loaded in $construct as iv_LIST_SOURCE as demo. Load whatever you want.
> 
>> Ok, now I understand - the demo searches for *any* occurrence of the entered
>> string within the list strings:
> 
> Yes. If the list is a combination of codes and text, you can search both code (normally in the beginning) text  (normally ”any” occurrence) to load the code.
> 
>> So to fill the list with strings *starting* with the entered values you
>> would need to do something like
>> 
>> Do
>> iv_LIST_SOURCE.$filter(left(upp(pv_CONTENTS),upp(iv_LIST_SOURCE.c1))>0,kTrue
>> )
> 
> It might be very useful sometimes.
> 
>> One little problem I encounter is that clicking the down button does not
>> display the full list.
> 
> Fixed if you download again:
> 
> http://www.adjob.se/download/typeaheadcombo.lbs.zip
> 
> Note that this combo also is useful within complex grids. You do not have to play with lists within lists.
> 
> /Mats_____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> 
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com

_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com




More information about the omnisdev-en mailing list