I am trying to build an app where there is an input field and a scrolling list field, when you enter something into the input field it filters the data in the scrolling list field and you can then choose your selection.
At the moment this is working as expected on first attempt, However when i go back to it for the second time and i enter something into the input field, it is only filtering the data on my list search.
For example, if the scrolling list has A,B,C,D in it, on the first time i search if i Type in C it will filter directly to C.
If i navigate away and back, on the second time i search, even though I can see A,B,C,D in the scrolling list field, when i type in the box either A,B or D it won't find it. It only seems to search anything that comes under C.
If I click away and go back again for the 3rd time, it works as expected.
Any hints as to where I should be looking to fix this?
This is the code of my search field
Code: Select all
local sFieldContent
on keyUp pKey
if sFieldContent is empty then
put the text of field "ScrollingList" into sFieldContent
end if
filter sFieldContent with "*" & the text of me & "*"
put sFieldContent into field "ScrollingList"
end keyUp
Code: Select all
on preopencard
put URL "url to my text file" into field "scrollingList"
end preopencard
I actually have two issues here.
Issue 1 - When i go to the card on the first attempt and type, it will filter correctly and do what i expect, when i navigate away from card and back to the card, even though all of the data is in the field, it only searches within the parameters of my last search. Note - if i navigate away and then back for a 3rd time, it seems to resent and works as i expect
issue 2 - If for any reason I decide to change my search half way through, for example i type in "a" in to the input field and the scrolling list shows all options beginning with "a" if i backspace and type in "b" it doesn't find anything as the scrolling list now only contains anything that has "a" in it.
I hope I have explained this well enough. Any advice is much appreciated. Thanks in advance