File Drop Combo control template

Top  Previous  Next

 

Click on a TAB to see its help

 

The FileDropCombo template generates code to display a data file in a scrollable list, select one of the records from the list, then assign a value from the selected record to a specified target field. Note that you may display one field (such as a description field) but assign another field (such as a code field) from the selected record (see Using drop-down lists to Lookup Records ). Also, because the template is based on a COMBO control, the generated code accepts entry values that may not exist in the displayed list and optionally adds these new values to the lookup file.

Immediately before you place the FileDropCombo Control template on your window, the Application Generator prompts you to specify the file to display in the drop-down list. Specify the file in the Select Field dialog. You will also need to select a field from the file to serve as the USE variable for the COMBO. The USE variable is significant when you Allow Updates from the FileDropCombo or when you display one field but assign another.

Immediately after you place the FileDropCombo Control template, the Application Generator opens the List Box Formatter so you can specify the fields to display in your list. You may specify the field containing the lookup value as well as other fields with associated information.

After you specify your list fields and return to the window under construction, RIGHT-CLICK the control, then choose Actions from the popup menu to complete the following FileDropCombo options:

General

Table Schematic Description

Enter a descriptive string that will be displayed in the Table Schematic window for this particular control. This allows you to distinguish one control from another when there are multiple controls populated in a single window.

Field to Fill From

The field in the lookup file whose value is assigned to the Target Field. Press the ellipsis (...) button to select from the Select Field dialog.

Target Field

The field that receives the value from the Field to Fill From. Press the ellipsis (...) button to select from the Select Field dialog.

More Field Assignments

Press this button to specify additional value assignments from the selected item's record.

Record Filter

Type a valid Clarion expression to limit the contents of the list to only those records causing the expression to evaluate to true (nonzero or non-blank). The procedure loops through all displayable records to select only those that meet the filter. Filters are generally much slower than Range Limits.

 

You must BIND any file field, variable, or EQUATE that is used in a filter expression. The Hot Fields tab lets you BIND fields.

Default to first entry if USE variable empty

Check this box to provide an initial default selection--the drop-down list is never initially empty (unless the first file record is a blank one).

IPDRV Options

Press this button if you are using the IP Driver in your application, and need to adjust the default settings in the IPDRV Options dialog.

Do not include Primary key in view

Check this box to specify that primary key components are not projected into the view. This is useful when working with SQL tables, and allows valid GROUP BY SQL statements to be generated.

Remove duplicate entries

Check this box to remove duplicates from the list.

Keep View synchronized with Selection?

Check this box to update the VIEWs record buffers to match the selected item.

Automatic Entry Field Completion

Check this box to allow the entry control to act as a incremental locator. As you enter characters, the template locates and populates the closest matching record in the list box (equal to or greater than the current entry field’s contents).

Case Sensitive matches?

Check this box to consider case when matching entered values with values in the lookup file.

Range Limits

This tab is only available if you specify a Key for the File in the Data / Tables Pad dialog. Because range limits use keys, they are generally much faster than filters.

Range Limit Field

In conjunction with the Range Limit Type, specifies a record or group of records for inclusion in the process. Choose a key field on which to limit the records by pressing the ellipsis (...) button.

Range Limit Type

Specifies the type of range limit to apply. Choose one of the following from the drop-down list.

Current Value

Limits the key field to its current value.

Single Value

Lets you limit the key field to a single value. Specify the variable containing that value in the Range Limit Value box.

Range of Values

Lets you limit the key field to a range of values. Specify the variables containing the upper and lower limits of the range in the Low Limit Value and High Limit Value boxes.

File Relationship

Lets you limit the key field to the current value in a related (parent) file. Press the Related file ellipsis (...) button to choose the range limiting file. This limits the process to include only those child records matching the current record in the parent file. For example, if your report was a list of Orders, you could limit the process to only those orders for the current Customer.

Colors

This tab is only available if you check the Color Cells box in the List Box Formatter. It displays a list of the FileDropCombo columns which may be colored.

 

To specify the default colors and any conditional colors, highlight the column's field name, then press the Properties button. This opens the Customize Colors dialog.

Customize Colors

This dialog lets you specify the default and conditional Foreground and Background colors for normal (unselected) rows; and for selected rows.

Conditional Color Assignments

Below the default colors section is the Conditional Color Assignments list. This list lets you set colors to apply when an expression evaluates to true (nonzero or non-blank). To add an expression and its associated colors, press the Insert button.

At run-time the expressions are evaluated, and the colors for the first true expression are used.

Icons

This tab is only available if you check the Icons box in the List Box Formatter. It displays a list of the FileDropCombo columns which can display icons.

You can also name a variable to use as the default icon, using the !variable format. The variable may be a string type that stores the icon filename, or check the The expression is a number check box if you are referencing a previously named icon assigned to the IconList property.

To specify default icons and any conditional icons, highlight the column's field name then press the Properties button. This opens the Customize Icons dialog.

Customize Icons

This dialog lets you specify the default icon and conditional icons for the FileDropCombo column.

Default Icon

The default icon to display. Type the icon (.ICO) filename. To specify a variable icon name, prefix the variable name with an exclamation point (i.e., !MyIconVariable)

 

Conditional Icon Usage

Below the Default Icon section is the Conditional Icon Usage list. This list lets you set icons to apply when an expression evaluates to true (nonzero or non-blank). To add an expression and its associated icon, press the Insert button.

At run-time the expressions are evaluated, and the colors for the first true expression are used.

Styles

This tab is only available if you check the Style box in the List Box Formatter. It displays a list of the List Box columns that may have applied styles.

To specify the default styles and any conditional styles, highlight the column's field name, then press the Properties button. This opens the Customize List Box Styles dialog. A default style may also be defined on the List Box Formatter Appearance tab.

 

Create GreenBar Effect

Check this box to create a GreenBar effect (alternating colors on each row) on your list box. You will be prompted to select two styles to use that represent the appearance of each alternating row

Default Style

This entry lets you specify the default style to be used for the column.

Conditional Styles

This list lets you define the styles to apply when an expression evaluates to true (nonzero or non-blank). To add an expression and its associated colors, press the Insert button.

Condition

Provide a valid Clarion expression that when evaluates to true (nonzero or non-blank) will cause the Style to be applied.

Style

Define the style number that will be applied to the column when the Condition evaluates to true (nonzero or non-blank).

At run-time the expressions are evaluated, and the styles for the first true expression are used.

All Styles must be defined. For more information on defining styles see FORMAT (set LIST or Combo layout).

Tooltips

This tab is only active if you check the Tooltip box in the List Box Formatter. It displays a list of the List Box columns which may have applied tool tips. Press the Properties button to display the Customize BrowseBox Tooltips dialog.

Tooltip variable

You can specify a default tool tip string value in the List Box Formatter. This entry lets you override the default tooltip to use a value contained in a variable. Press the ellipsis button to select a variable that will contain the text of your column’s tool tip.

 

Update Behavior

This tab lets you use the entry portion of the COMBO to initiate adding a new record to the lookup file. If the user types a value in the entry box that is not already in the list, the generated code can add a new record directly, or it can call a separate procedure to add the new entry.

Allow Updates

Clear this box to only allow items in the drop list to be entered as as valid entry. Values not matching the target field in the drop list will be automatically cleared.

 

Check this box to add new entries to the lookup file, and to enable the Update Procedure prompt. If the Update Procedure prompt is left blank, an entry not in the drop list will pop up a window that contains the following message:

 

"Record Match not found, do you wish to add a new one?"

 

If you press the "Yes" button, the new value will be accepted, and added to the lookup file. If you press the "No" button, the entry will be cleared and not added to the lookup file.

 

If you wish to allow unvalidated entries (entries NOT contained in the lookup file), use a standard File Combo control.

 

Update Procedure

Name the procedure to call to add the new record, or leave this field blank if no update procedure is needed.

 

No update procedure is needed for lookup files with only one required field (the field specified by the COMBO's USE variable). Non-USE fields are CLEARed, unless range limited or auto-incremented.

 

 

Silent Automatic Add

This option is used is you wish to allow "silent adds" to the drop combo list box, without confirmation or display of an update procedure. This option is only enabled if you have checked the Allow Updates box, but have not entered an Update Procedure.

Hot Fields

Use the Hot Fields tab to specify fields to add to the QUEUE that are not displayed in the list. When scrolling through the file, the generated source code reads the data for these fields from the QUEUE, rather than from the disk. This speeds up list box updates.

Specifying Hot Fields effectively lets you update other controls whenever a new record is selected in the list box. Elements of the Primary Key and the current key are always included in the QUEUE, so they do not need to be inserted in the Hot Field list.

Press the Insert button to add fields to the list.

If the field you are BINDing is not in the VIEW, check the Not in View checkbox.

Sort Fields

This tab lets you add fields by which the items in the drop-down list are sorted. The sort fields are in addition to any Key specified for the FileDropCombo. Press the Insert button to add fields to the list.

Classes Tab

Use the Classes tab to override the global settings for the Class. See Classes Tab.

Other Prompts

The List Properties for this control are the same as for a list; however, the following prompts may require some additional explanation:

Use

Takes either a field equate label or the label of a variable to receive the value from the first field populated in the list. In the FileDropCombo Control template context, the assignment functionality is replaced by the more flexible Target Field; however, the USE variable is significant when you Allow Updates from the FileDropCombo (see Update Behavior for more information).

From

This field defaults to Queue:FileDropCombo. Queue:FileDropCombo is the field equate label of the QUEUE the template generates to fill the list. Typically, you should not change this value.

Mark

Takes the label of the Queue:FileDropCombo:Mark QUEUE field to allow the user to select more than one item from the list. The Queue:FileDropCombo:Mark field contains 1 for selected items and 0 for unselected items.