| **Navigation:**  [[templates.htm|Templates]] > Guide to all Templates > Control Templates >====== File Drop control template ====== | [[tplcontrolfieldlookupbutton.htm|{{btn_prev_n.gif|Previous page}}]][[templates.htm|{{btn_home_n.gif|Return to chapter overview}}]][[file drop combo control template.htm|{{btn_next_n.gif|Next page}}]] | | || {{filedroptab1_shg.jpg|FileDropTab1_shg.jpg}}[[tplcontrolfiledrop.htm#tplcontrolfiledrop styles|]][[tplcontrolfiledrop.htm#tplcontrolfiledrop icons|]][[tplcontrolfiledrop.htm#tplcontrolfiledrop colors|]][[tplcontrolfiledrop.htm#tplcontrolfiledrop range limits|]][[tplcontrolfiledrop.htm#tplcontrolfiledrop general|]]{{filedroptab2_shg.jpg|FileDropTab2_shg.jpg}}[[classes tab.htm|]][[tplcontrolfiledrop.htm#tplcontrolfiledrop sort fields|]][[tplcontrolfiledrop.htm#tplcontrolfiledrop hot fields|]][[tplcontrolfiledrop.htm#tplcontrolfiledrop tooltips|]] **//Click on a TAB to see its help//** The FileDrop template places a file-loaded scrollable drop-down list on a window. At runtime, the end user can select an item from the list, then assign a value from the selected item's record to a specified target field. 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.htm|Using drop-down lists to Lookup Records]]). {{tipbox.jpg|TipBox.jpg}} Set the DROP attribute to zero (0) to display a list box rather than a drop-down list. Immediately before you place the FileDrop 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 to serve as the USE variable for the LIST; however, the field you select is only significant if you are displaying one field but assigning another). Immediately after you place the FileDrop 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 from the same or related files. 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 FileDrop 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. | | | Press the **E **button to call the Expression Editor. This dialog is used to help you construct syntactically correct expressions to use in the appropriate prompts. | | | You must [[bind declare runtime expression string variable .htm|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** | **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. See also [[tplcontrolbrowsebox.htm#tplcontrolbrowsebox sqladvanced|SQL Advanced Tab]] | **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 FileDrop 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. | | | Press the **E **button to call the Expression Editor. This dialog is used to help you construct syntactically correct expressions to use in the appropriate prompts. | | | 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 FileDrop columns which can display icons. 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 FileDrop column. | | **Default Icon** | The default icon to display. Type the icon (.ICO) filename. 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 [[prop iconlist.htm|IconList]] property. | | **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. | | | Press the **E **button to call the Expression Editor. This dialog is used to help you construct syntactically correct expressions to use in the appropriate prompt. | | | 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. {{tipbox.jpg|TipBox.jpg}} **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. | \\ | \\ | | | | Press the **E **button to call the Expression Editor. This dialog is used to help you construct syntactically correct expressions to use in the appropriate prompt. | \\ | \\ | | | **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. **Hot Fields** When you select the Hot Fields tab, you can specify fields not populated in the list to add to the QUEUE. 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 also lets you place controls outside the FileDrop that are updated whenever a different 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. This dialog also lets you BIND a field. You must BIND any field, variable, or EQUATE that is used in a filter expression or as a field to total. 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.htm|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 FileDrop Control template context, this functionality is replaced by the more flexible Target Field setting. | | **From** | This field defaults to Queue:FileDrop. Queue:FileDrop is the label of the QUEUE the template uses to fill the list. Typically, you should not change this value. | | **Mark** | Takes the label of the Queue:FileDrop:Mark QUEUE field to allow the user to select more than one item from the list. The Queue:FileDrop:Mark field contains 1 for selected items and 0 for unselected items. |