Setting up an Auto Fill IOS text field

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Setting up an Auto Fill IOS text field

Post by FireWorx » Mon Mar 12, 2012 1:36 am

Hi,
I have uploaded a little stack that compares text being typed into a field with another field holding many words. As you type it compares your entered text against the larger data field and loads matching results. The stack loads in the iOS tester and you can see it works there or on the desktop. I would like to set this up with IOS text fields but have had no luck placing the On KeyDown pKey handler or the rawKeyUp handler.

I started trying to work toward the end result with the code below but with no luck.

on inputEndEditing
put iphoneControlGet ("fType", "text") into tFilter ## the text entry field
put fld "fList" into tCont ## the field container holding all the words
  put tFilter &"*" into tFilter
 filter tCont with tFilter
 iphoneControlSet "tFound", "text", tCont
end inputEndEditing
Attachments
AutoFillExample.livecode.zip
(2.78 KiB) Downloaded 313 times

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: Setting up an Auto Fill IOS text field

Post by FireWorx » Thu Mar 15, 2012 2:05 am

No takers?

I want to query a database and select a few hundred street names and place them in a global variable. As the user types in the first few letters of the street name I want to filter the variable and auto populate a list field next to it with street name choices from global variable. This is for emergency responders in a fire truck bouncing down the road. Typing in those type of situations is a pain. Why type 15 letters when I can type 3 and then click a line in the list and open the map page on the screen?

The dictionary says RawKey Down works in IOS. Should I just use regular live code fields? The little stack does works with basic live code fields in the tester but I thought the apple review nazis (toung and cheek) would rather i used IOS fields.

Dave

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4171
Joined: Sun Jan 07, 2007 9:12 pm

Re: Setting up an Auto Fill IOS text field

Post by bn » Thu Mar 15, 2012 8:07 am

Hi Dave,

I made a little stack that uses a native iOS Input field. The field that has only one line.

I have set it up with your search list and search algorithm (filter). It assumes that the search list only has one word per line. It works in the simulator the same as your stack.

iOSSearchfield.livecode.zip
(6.91 KiB) Downloaded 344 times

kind regards

Bernd

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: Setting up an Auto Fill IOS text field

Post by FireWorx » Thu Mar 15, 2012 6:41 pm

That is Sweet ! On my birthday no less! I tested it on the two word streets below and works just as well !
Thnaks ! You da Man!
Dave

Via Tornasol
Via Medici
Vista Point
Valley View
Via Lantana
Viista Point

Post Reply