Configuring the Search BuilderTango Search Builder Options and SetupThe Search Builder builds a series of actions that allows you to create Web forms that can be used to search a database, display the results of the search, and view, update, and delete individual records. The topics covered in this chapter include:
![]() About the Search BuilderUsing the Search Builder you can quickly and easily build the actions necessary to:
Based on the settings in each of the option groups and the actions generated, the following are examples of what users might see in their Web browsers. By default, a Begins with search is performed on text columns and an = (equals) search on all others. If desired, you can instead let users select each search operator from a drop-down list. |
|||||||||||||||||||
If desired, you can configure the Search Builder to display Next and Previous buttons for paging through large result sets. To view detailed information for a record, the user clicks the name of the record in the list, which is hot text, linked to the record detail. The record detail page displays more information on the selected record and--if you allow it--lets the user edit or delete it. When you open the Search Builder window it contains three main groups of options you can specify: Search, Record List, and Record Detail.
To switch among option groups, click the appropriate tab in the Search Builder window. ![]() Setting Search Options |
|||||||||||||||||||
![]() |
When you drag the Search Builder icon from the Actions bar into an
application file, the Search Builder window opens, displaying the Search
options window.
You use the search options to define the appearance of the search form, which columns the user can search on, and how the values entered by the user are used to search the database. You can also define fixed criteria in addition to the ones the user enters. Search Columns ListDrag columns from the Data Sources Workspace to this list to use them in defining the search. Columns in the Search Columns list appear in the format table_name.column_name. The order of the columns in the Search Columns list determines the order of the fields on the resulting search form. The following table describes the operations you can perform on columns. Column OptionsUse the Column Options section of the Search window to configure each search column. You can specify how each column's entry field appears on the search form and how the value entered by the user is used to search the database. Field TitleIn Field Title, set the title of the value entry field for the column as you want it to appear on the search form. OperatorUse this option to set the search operator for the column. For example, if the operator is set to Begins with, Tango searches the database for records that begin with the column's search value. If you select User Enters, the search form displays a drop-down list of the operators available, and the user can select which operator to use. User Enters ValueSelect this option if you want the user to enter a value in an entry field on the search form. The available field types are: Text, Drop-down List, List Box, Check Box, and Radio Buttons. Field TypeTo select a value entry field type for a column, select the column in the Search Columns list and select an item from the Field Type drop-down list. A Field Properties dialog box appears allowing you to specify values for the field. |
||||||||||||||||||
![]() |
You can edit a field's values at any time by clicking the Field
Properties button in the Search Builder window or by choosing
Field Properties from the Attributes
menu.
The following describes each of the options in the Field Properties dialog box for each field type:
Use the Field Properties dialog box for these field types to specify the values and choose the default. The same dialog box appears for all three field types. To add an item to the values list
Checked Value is the value to be used for the search if the check box is selected by the user. If the check box is not selected, an empty value is used. Initially Checked specifies whether the check box should be checked by default. Fixed ValueWhen this option is selected, the search value is hard-coded and no entry field appears on the search form. The value you specify is used for every search. |
||||||||||||||||||
Using the Value drop-down list, select one of the following options for a fixed value:
|
|||||||||||||||||||
For more information on what the CGI parameters evaluate to, see "<@CGIPARAM>" in the Meta Tags and Configuration Variables manual. |
Summary: Setting Column OptionsThe following table describes the settings you can make in the Column Options section of the Search window. ![]() Formatting the Search PageUse the format options to define how the search fields and their titles display. To change the format of the search page |
||||||||||||||||||
![]() |
Do either of the following to change these options:
![]() Customizing Your Search Form and Creating Result MessagesHeader, Footer, and No Results HTMLUse Header HTML and Footer HTML to customize the search form by specifying HTML to appear above and below the search form. No Results HTML lets you specify the HTML to return when no records match the search criteria specified by the user. To enter Header HTML, Footer HTML, or No Results HTML |
||||||||||||||||||
![]() |
Changing Button TitlesThe search form contains two buttons below your search fields:
To change button titles |
||||||||||||||||||
![]() |
![]() Setting Record List OptionsUse the options in the Record List window of the Search Builder to define the appearance and functionality of the Web page returned after the search (defined in the Search section) is performed. Among other things, you can specify:
Display ColumnsDrag columns from the Data Sources Workspace to this list to have them retrieved from the database and displayed on the record list Web page. The order in which columns appear in the Display Columns list determines their order on the Web page. Order ByRecords from the database are sorted on the record list page according to the order specified in the Order By list. You can drag any number of columns into this list; however, each of the columns must also appear in the Display Columns list. The records are sorted by the first column
listed. Then records having the same values in that column are ordered
by the second column, and so on. The default sort order is ascending,
meaning records with lower values in the sort column appear first in
the list. You can toggle between ascending and descending by clicking
the |
||||||||||||||||||
Column OptionsUse the Column Options section to set up options for each column in the Display Columns list. Field TitleIn the Field Title field, enter the text you want to appear as the column title. Display AsYou can specify how you want the columns returned to display in the browser after the search. From the drop-down list, select from the following options: |
|||||||||||||||||||
For more information, see "Encoding Attribute" in the Meta Tags and Configuration Variables manual. |
|
||||||||||||||||||
For more information, see "Encoding Attribute" in the Meta Tags and Configuration Variables manual. |
Format AsThe Format As field is enabled only when you select either the Normal Text or Link to Detail option from the Display As drop-down list. |
||||||||||||||||||
For more information, see "Format Attribute" in the Meta Tags and Configuration Variables manual. |
Each of the following options in the drop-down list (except No Formatting) adds a FORMAT="formatstring" attribute to the <@COLUMN> tag in the HTML generated for the column in the Record List action's Results HTML. The following table lists the options and the corresponding format string.
DecimalsSpecify the number of decimal places you want to display for number and currency values. The Decimals field is available only when you select one of the number or currency options from the Format As drop-down list. The default is 0 for number options and 2 for currency options. An empty or non-numeric value is evaluated as 0. Add HTML line breaksThis option is available only when you select Normal Text or HTML from the Display As drop-down list and No Formatting is selected from the Format As drop-down list. Otherwise, this option is disabled. Maximum MatchesUse the options in this section to restrict the number of matches displayed on the record list page. Limit ToSelect this option to limit the number of records returned by the search to the number specified. For example, to show only the first 10 records matching the search criteria, select this option and enter "10" in the Limit To field. No MaximumIf you select the No Maximum option, all records matching the search criteria are retrieved and displayed on the record list page. Show Multiple Pages If Limit ExceededIf you specify a maximum number of matches in the Limit To field, this option is available. If selected, a Next button appears on the record list page (if the number of matching records exceeds the limit entered), along with an indication of the total number of records matching and which records are being displayed. When the user clicks the Next button, the next group of matching records appears. A Previous button appears on record list pages beyond the first, which allows the user to go backwards in the list of matching records. |
||||||||||||||||||
![]() Formatting the Record List Page |
|||||||||||||||||||
![]() |
Use the format options to define how the record list is displayed.
Tango displays results records in a table with one row for each record. To change the format of the record list page
The Page Format dialog box appears. Specify the table attributes as follows:
![]() Customizing Your Record List PageHeader and Footer HTMLYou use Header HTML and Footer HTML to customize the record list page by specifying HTML to appear above and below the record list. To enter Header HTML and Footer HTML |
||||||||||||||||||
![]() |
![]() Setting Record Detail OptionsUse the options in the Record Detail window of the Search Builder to define the appearance and functionality of the Web page returned when a user clicks on a record on the record list Web page. This page displays a single record and supports user editing and deletion, if you choose to allow it. |
||||||||||||||||||
Display ColumnsThe columns appearing in this list are displayed on the record detail Web page. To add a column to the list, drag it from the Data Sources Workspace. The order in which columns appear in the Display Columns list is the order they appear on the record detail page. Column OptionsUse the Column Options section of the Record Detail window to configure each detail column. This section describes each of the column options. Field TitleIn the Field Title field, enter the title to appear for this column's value on the detail page. Allow UpdateSelect this option to allow the user to change the value of the column on the record detail page and save the changes to the database. Field TypeIf you select the Allow Update option for a column, the Field Type drop-down list and Field Properties icon are enabled, allowing you to select the type of value editing field you want to appear for the column on the detail page. As with the search form, you can select from the available field types: Text, Drop-down List, List Box, Check Box, and Radio Buttons. |
|||||||||||||||||||
You specify the field type and its options the same way you do in the Search window of the Search Builder. The selected column's Field Properties dialog box for each field type is the same in the Record Detail window as it is in the Search window, except you cannot specify a default value (text field type) or a selected item (drop-down list, list box, check box, and radio buttons). This is because the value of the column in the detail record determines the field's initial value. When creating value lists for drop-down list, list box, and radio button field types in the Record Detail window, make sure you enter the item values exactly as they appear in the database, and include all possible values. If Tango cannot find the column's value in the list when it is constructing the detail page for a record, no item is selected by default. Depending on the user's browser, the first item may be selected or no item may be selected. Either way, if the user saves the record--even if no changes are made to that particular field--a new value (an empty value or the first value in the list) is saved in it. For similar reasons, make sure check box fields are used only for columns that can contain either an empty value or the value you specify as its checked value. Setting Column Options: Display As, Image Path, Format As, Decimals, and Add HTML line breaksSetting these options is identical to setting the column options for the Record List page, except as follows:
Record OptionsIf you select the Allow Delete of Record From option, a Delete button is added to the record detail page, giving the user the ability to delete the current detail record. Deleting records from multiple tables simultaneously is not supported by the Search Builder, so if you have included columns from more than one table in the Display Columns list, use the drop-down list to select the table whose record you want to delete. ![]() Formatting the Record Detail PageUse the format options to define how the detail column values and their titles are displayed. To change the format of the record detail page |
|||||||||||||||||||
![]() |
The Page Format dialog box appears. Specify the table attributes as follows:
![]() Customizing Your Record Detail Page and Creating Response MessagesHeader, Footer, Update Response, and Delete Response HTMLYou use Header HTML, Footer HTML, Update Response HTML, and Delete Response HTML to customize the detail page. Using Header HTML and Footer HTML, you can edit the HTML that you want to appear above and below the record data. Using Update Response HTML and Delete Response HTML, you create messages in response to record updates and deletions. To enter Header HTML, Footer HTML, Update Response HTML, or Delete Response HTML |
||||||||||||||||||
![]() |
Button TitlesWhen you make a field updatable, or when you allow users to delete records from the detail page, buttons for these actions are added to the record detail Web page. The record detail Web page contains three buttons below your record detail fields: Save, Reset Values, and Delete. To change button titles |
||||||||||||||||||
![]() |
![]() Search Builder TipsYou can use the Search Builder to create actions that do not follow the standard search form, record list, and record detail sequence.
![]() Defining Joins |
||||||||||||||||||
For complete details on what joins are and how to define them using Tango Editor, see "Joining Database Tables". |
You can include columns from more than one table in a search, if you define joins for the tables. If you select columns from more than one table in a search, a dialog box appears telling you to define a join. Either choose Define to go directly to the Join tab or Later if you want to define the join at a later time. When you define the join, it adds the columns to the search. You must, however, define the join before you build the actions for the search or you save the application file.
![]() Actions Built by the Search BuilderThe actions built by the Search Builder appear in the application file. |
||||||||||||||||||
The following table describes the actions resulting from the Search Builder process and the conditions under which actions are built: |
|||||||||||||||||||
This section appears only if record list columns are specified. If no Form is present, this is an If action named IfList.
This section appears only if detail columns are specified. If no RecordList or Form section exists, this is an If action named IfDetail. This section appears only if updatable detail columns are specified.
This section appears only if the Delete option is specified for the Record Detail page. |
|||||||||||||||||||
For information about the delete response, see "Header, Footer, Update Response, and Delete Response HTML". |
|||||||||||||||||||
HTML SnippetsThe Snippets Workspace contains a snippets folder named Builder Snippets, and a subfolder named Search. The Search folder contains snippets for the Form Header, Form Footer, Record List Header, Next/Previous Buttons, Record List Footer, No Matches, Record Detail Header, Record Detail Footer, Update Response, and Delete Response. The Search Builder uses these snippets in the designated places as default values for the named attributes. To change the default values, you can edit these snippets. |
Copyright © 1998, Pervasive Software Inc. All rights reserved.