How to make LIST OBJECT find EDIT BOX Input?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • How to make LIST OBJECT find EDIT BOX Input?

    Is there a way to get List Object to scroll to a Line by matching Text?

    Say for example the user starts Typing in Chevrolet. I am trying to get the List Object to scroll to C as they type C, then CH as the type CH.

    Currently I have this in the List Object and it automatically sorts the names.

  • You can definitely get the two to interact. I use a combination of Edit Box & List Object (and a second list using Internal List) to do filter-as-you-type. That's a bit different to what you want, as instead of scrolling to the line, it deletes list items as you type (like Fusion's "Create New Object" window does, for example). For your case, I guess you would do it something like this:

    -Every time the user presses a key, run a fastloop as many times as there are typed letters:
    run fastloop "letterByLetter" Len(Edittext$( "yourEditBox" )) times

    -In fastloop "letterByLetter", run a different fastloop as many times as there are items on the list:
    on loop "letterByLetter": run fastloop "ItemByItem" List Nb Lines( "yourList" ) times

    -In fastloop "ItemByItem", check whether the first character(s) of a line match the first character(s) of the edit box. If so, set current line to this line. Also stop the "ItemByItem" loop here, so that the first match is selected (eg. "CH" = Chevrolet) and not subsequent ones (eg. "CH" = Chrysler)
    on loop "ItemByItem": If Left$(List Data( "yourList", loopindex("ItemByItem") ) ,loopindex("letterByLetter")+1 ) = Left$(Edittext$( "yourEditBox" ),loopindex("letterByLetter") +1)
    ----------------------------- Set current line of "yourList" to loopindex("ItemByItem")
    ----------------------------- Stop loop "ItemByItem"

    The first time "ItemByItem" is run, it will try and match single characters (eg. "C"). Once a match has been found in the previous line, the first fastloop "letterByLetter" will run again, this time looking for 2 characters (eg. "CH"), and so on. Hopefully I haven't made any mistakes and the above does actually work as intended. To prevent potential unnecessary lag, you may also want to add some code to count how many matches there are per character combination and stop the loops from executing once the only possible match has been found (eg. once the user has typed "CHE"), or if no matches have been found (eg. if the user loves Trabants and has typed "TR")




    In case you're interested in the filter-as-you-type variant, below is how I do it. I keep a master list separate in an internal list object (the yellow icon). I copy that to the List Object, then delete items from the List Object as needed, restoring from the Master List when necessary:


    Please login to see this picture.

    Please login to see this picture.

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

    Edited once, last by Volnaiskra (September 7, 2023 at 1:23 AM).

  • Can't it just be done a lot simpler?

    If you create an alterable string on the edit object and name it "old"

    then create the following event:

    Compare two general values "old ("Edit Box")" is different than "Edittext$( "Edit Box" )" then
    -> Set "old" on Edit Box to "Edittext$( "Edit Box" )
    -> Set current line on List Object to: FindString( "List", Edittext$( "Edit Box" ), -1 )

    See attached example

  • Can't it just be done a lot simpler?

    If you create an alterable string on the edit object and name it "old"

    then create the following event:

    Compare two general values "old ("Edit Box")" is different than "Edittext$( "Edit Box" )" then
    -> Set "old" on Edit Box to "Edittext$( "Edit Box" )
    -> Set current line on List Object to: FindString( "List", Edittext$( "Edit Box" ), -1 )

    See attached example

    Indeed - that's much better X)

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

  • Can't it just be done a lot simpler?

    If you create an alterable string on the edit object and name it "old"

    then create the following event:

    Compare two general values "old ("Edit Box")" is different than "Edittext$( "Edit Box" )" then
    -> Set "old" on Edit Box to "Edittext$( "Edit Box" )
    -> Set current line on List Object to: FindString( "List", Edittext$( "Edit Box" ), -1 )

    See attached example

    Oh my God. This is Awesome. Excellent Example! Thank you very much!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!