I would like to have the following behavior in my application…
My user is looking at a list being displayed on a form. Let’s say it is a form, called Form1, which contains a tabpanel called Tabpanel1. Tabpanel1 contains for form, Form2, which is set to Record View (locked).
Let’s say that the table underlying Form2 has 200 records in it. When my user brings up Form1, he can see the list of 200 records. From Form1, he would like to be able to select an item in the table from a valuelist, and have the list “move” to that record. Not filter on it, eliminating everything else, but just scroll the list to where that record is. From there, he should still be able to scroll up and down to the rest of the list.
I can create the forms, of course, and the valuelist, and display the data. I can also filter the data by doing a search, but I haven’t been able to figure out a technique for moving/scrooling the list within the form on the tabpanel, and set the curser to the record that I select, programmatically. The user could scroll down manually, but as the list gets longer and longer, this could prove to be a pain in the neck.
Have I missed something obvious?
As always, thanks for any guidance that you are able to provide.
I thought that .setSelectedIndex might be something worth pursuing. But, this is getting the xth item in the database table (x = the selected index), and the items in the database table aren’t necessarily in the order that I need. (and while it’s scrolling down the list, it’s putting the item into the display, but not necessarily at the top of the list)
So, to add some further clarification to my earlier message, I think what I really want is to take the foundset for the form, sort in a particular order, and display it in that order. Then, the user should be able to pick an item from the valuelist, and have the application find that item in the sorted list, and scroll down to that location, and hopefully, put it right at the top of the display window.
I’ve come up with one solution, and this one does involve using .setSelectedIndex. I can sort the foundset into the proper order. When the user selects an item from the valuelist associated with the list being displayed, I can loop through the foundset, one record at a time, using .setSelectedIndex to scroll through the foundset. At each index, I check the record to see if it matches the criteria that the user selected. When it matches, I drop out of the loop, and because the selected index has changed, the positioning of the displayed list changes as well.
This seems to work. I just thought that there might be a more elegant way accomplish this. So, any further thoughts would still be appreciated.