'live type' filtering of list box.

Hennell

Member
Licensed User
Longtime User
Its quite possible this has a really obvious solution, such as a simple pre-made control or library file but I figured I might as well ask.

I'm trying to make a 'live search' effect, for choosing the city option for a database app. Essentially the user should be able to start typing the first letters of the city they want, and the list of cities starts reducing based on what is typed. (Like what happens when you search on facebook :))

I've managed the basic effect fairly easily with a text box a list box and a table, where the list box reads the table which is filtered by the text box contents when you click a button. (Might make more sense if you look at the file).

My problem is I want to do away with the button and have the table/list box filter as the text box is typed into. I originally tried this with text box key press event, but that updates the text box after the event has finished so it doesn't filter properly.

I've attached a quick & basic version of the effect bellow to demonstrate what I mean: essentially the idea is to get rid of the button so it filters automatically.

(If there is a really obvious way to do this or something very similar please mention it; I haven't looked much yet (I started this on my PDA and liked the challenge of this idea :D) I'm just wondering if there is a way to do this in the way I've tried....)
 

Attachments

  • livefilter.sbp
    1 KB · Views: 265
Last edited:

Rioven

Active Member
Licensed User
Longtime User
Hi Hennell,

One simple workaround is to make your own virtual keyboard image or buttons to trigger the input event as I found on some contact applications.

see attached, sample demo(using buttons).

Regards,
 

Attachments

  • livefilter-ex1.sbp
    1.6 KB · Views: 248
  • contacts.JPG
    contacts.JPG
    22.7 KB · Views: 264
Last edited:

klaus

Expert
Licensed User
Longtime User

Attachments

  • LiveFilter_ex2.zip
    4.7 KB · Views: 227

Rioven

Active Member
Licensed User
Longtime User
:sign0161: I should start exploring this said great door library!
I was away for sometimes and not thoroughly read the forum.
Thanks,
 
Top