VDF-GUIdance logo



  Visual DataFlex Logo
  

Shared knowledge leads to accumulated knowledge

        Printer Friendly Page


Size: 7 KB Download
Date Created: 11/21/2002
Date Updated: 11/21/2002
Author: David Martinko
Company: Redeemed Software
Summary:
PLEASE USE THE AUTOCOMPLETE WHICH REPLACES THIS PKG. (see link website)

cDbForm_DSFlist


By David Martinko

Compatibility


VDF7 or higher required

Definition


The cdbForm_dsflist class which is short for "databound form with a dynamic sizing floating list", can be regarded as an IDE-compatible AUTOCOMPLETE solution.
This class is used to help aide in data entry. As you type, a list is shown with possible matches to what you are typing. If you see what you want in the list, you press ENTER to select the text to complete what you started typing

Usage


After placing the object on your view, select the file.field you wish to data to be connected to. You may choose a separate file.field for data to be displayed from by setting the Alt_Data_File and Alt_Data_Field. You must set the Float_Index to the index you wish the searching to be performed on. This index needs to be a unique index for the data being displayed otherwise you will have the data repeated many times.

I don't recommend you use this on a field for a last name because you when the user types "SMITH", all they will see is a list containing only "SMITH" and will never see "SMITHERS" until they type the "E".

If the data is coming from the same file (i.e. you didn't set the Alt_Data_File) then you can set the Float_Find to TRUE. This option will allow the record you just selected to become the current record. This action is simular to that of the selectionlist class, just a bit faster for data entry. Let's say you want to use the Float_Find in an Invoice# field. You want to help the user by showing all possible invoices matching what they entered. In this case, it would help to show the find results in descending order. This can be done by setting the Find_Dir to DF_DESCENDING.

You can control the number of finds done by setting the Max_Finds. This is beneficial when working with large files where a single key press could slow down the system if you find every record starting with the entered character. I recommend you set the limit to 10. After the first 10 matching records have been found, it jumps out of the find loop, even in descending order.

Below is the example code that created the image above:
    Object oDbform_DSFList1 is a cDbform_DSFList

        //AB-StoreTopStart
        Set Alt_Data_File  To Country.File_Number
        Set Alt_Data_Field To 1 // Country.Name
        
        //AB-StoreTopEnd

        Set Float_Index to 1
        Set Max_Finds to 15
        Set Enter_Find to TRUE
        Set Label to "Country:"
        Set Size to 13 186
        Set Location to 57 64

        //AB-StoreStart
                
        //AB-StoreEnd

    End_Object    // oDbform_DSFList1

Installation


We will describe here how-to install this package into the orderentry workspace
  • Copy the *.pkg file to the .\Order\AppSrc folder
  • Copy the *.dfc and *.bmp files to the .\Order\IdeSrc folder
  • Open your IDE and go to the tools menu, select Maintain classlist
  • Select the workspace tabpage as we want to install this in one workspace for now
  • Click the Add button to open the "Open a New Class In The Current Workspace" dialog and enter the following details:
    1. Name: cDbform_DSFList
    1. Image: cdbForm_dsflist.bmp
    1. Page : Data
    1. File: cDbform_DSFList
  • Click the ADD-button
  • Click Ok


Suggestions


Have a datafile for Cities. As the user types, they can select a City from the list. Modify your save routine to check if the city exists and add it if not. Then a simple entry screen for the users to edit any cities that maybe in the list to remove misspellings or duplicates (i.e. Clinton Township, Clinton Twp).

Download


cdbform_dsflist.zip ~ 7 kb