1 Reply Latest reply on Mar 29, 2011 8:28 AM by philmodjunk

    Scrolling directly to record in my Portal List using the first few letters

    HowardChernick

      Title

      Scrolling directly to record in my Portal List using the first few letters

      Post

      In a previous post, i was shown how to create a Listbox using a Portal.  By selecting an item in the list, I am now able to display values associated with that selected item.

      This list contains thousands of records. 

      Suppose my listbox contains a list of every name in the world. How can I type the frst few letters of a name that i am searching for and be able to scroll to the first occorrence of that name. At that point, I would retrieve the values of that record.

      For example, I start typing M and the fisrt name beginning with M will be the currently selected item. If I then type i, the first name beginning with Mi will be slected and so on.

       

      Thank You!!

        • 1. Re: Scrolling directly to record in my Portal List using the first few letters
          philmodjunk

          Instead of scrolling (which can be done, BTW), why not "filter" the list so that the list displays only the records that match the text you have entered? That's easier to implement.

          You can set up a text field just above the portal, I'll name it Search. Then you can give the portal this filter expression:

          YourTable::Search = Left ( YourTable::SetName ; Length ( YourTable::Search ) )

          Write this simple script:

          Commit Records/Requests
          Refresh Window [Flush cached join results]
          Set Selection [YourTable::Search ; start position: Length ( YourTable::Search ) + 1 ; end position: 0 ]

          And use the OnObjectModify Script trigger on the search field to perform this script which forces the filtered portal to update with each keystroke.

          Here's demo file you can download with two different versions of this selection portal plus two enhanced implementations of auto-complete enabled dropdown lists that enter ID numbers instead of names:  http://www.4shared.com/file/umvOy55n/EnhancedValueSelection.html