Configuring the New Record BuilderTango New Record Builder Options and SetupThe New Record Builder builds a series of actions that allows users to add a record to a database. For the new record, you specify the database columns the user can add data to and the result message to return after the record is added. Tango does the rest. The topics covered in this chapter include:
![]() About the New Record BuilderYou use the New Record Builder to build actions that, when Tango Server executes them, display a form allowing users to enter data for a new record and return a result message after the record is added to the database. The user enters the values for the columns in the new record, and clicks Save to save the record. Tango Server saves the record to the data source and returns the HTML response you specified in the New Record Response HTML. ![]() Setting New Record Options |
|
![]() |
When you drag the New Record Builder icon from the Actions bar into
an application file, the New Record Builder window appears.
All the options necessary for configuring the New Record Builder appear in its options window. ColumnsThe columns you include in this list are the columns the user assigns values to in the new record. To add columns to the list, drag them from the Data Sources Workspace. Columns appear in the format table_name.column_name. You can only add columns from one table. The order in which the columns appear in the Columns list determines their order on the resulting new record entry form. The following table describes the operations you can perform on columns. Columns OptionsUse the Column Options area to configure each column appearing in the Columns list. You can specify how each column's entry field appears on the new record entry form and whether a value is required for it or not. Field TitleIn this field, set the title of the value entry field for the column as you want it to appear on the new record entry form. User Enters ValueSelect this option if you want the user to enter a value in an entry field on the new record entry form. Field TypeTo select a value entry field type for a column, select the column in the Columns list and select an item from the Field Type drop-down list (Text, Drop-down List, List Box, Check Box, or Radio Buttons). A Field Properties dialog box appears allowing you to specify properties for the field. |
![]() |
You can edit a field's properties at any time by clicking the Field Properties icon in the New Record Builder window or by choosing Field Properties from the Attributes menu. The Field Properties dialog box for the specified type of field appears. For example, in the case of a text field: |
For more details on the different types of field that can appear here (text, drop-down list, list box, check box, or radio buttons), see "Field Type". |
The following describes each of the options in the Field Properties dialog box for each field type.
Fixed ValueIf you select this option, no entry field appears on the new record entry form. The value you specify is used for every new record. 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 "Assigning Variables With the Assign Action", and "<@CGIPARAM>" in the Meta Tags and Configuration Variables manual. |
RequiredSelect this column option to prevent a record from being added, unless the user enters a value. If the user tries to leave the value field empty, an error message is returned. If you select Fixed Value for the column, the Required option is not available. It is also not available for columns configured to use the Check Box field type. This is because a check box can have only two values: empty and the one you specify in the Field Properties dialog box. Making it required would mean the record could not be added unless the user checks the checkbox, in which case you could use the Fixed Value option for the column and have it not appear on the Web page. Summary: Setting Column OptionsThe following table summarizes how to set column options for the New Record Builder. ![]() Formatting the New Record FormUse the format options to determine the layout method to display the value entry fields and their titles. To change the page format options of the new record form |
![]() |
Do either of the following:
The Page Format dialog box appears. Tango aligns the page fields using an HTML table. Specify the table attributes as follows:
![]() Customizing Your Form and Creating Result MessagesThe Snippets Workspace includes the default builder HTML snippets described in this section. They include snippets for Form Header, Form Footer, and New Record Response. Header, Footer, and New Record Response HTMLYou use Header HTML and Footer HTML to customize the new record entry form by specifying HTML that is placed above and below the entry form. The New Record Response HTML is returned after the user saves the new record. The Column Snippets folder in the Snippets Workspace contains the names of all the columns in the table being inserted into. Dragging a column name to the HTML editing field causes an <@COLUMN> tag to be added to the HTML. When the application file is executed, the column's value in the new record is included at that location in the response. To display values from the new record, Tango must be able to get those values from one of three places: the new record form submitted by the user, a fixed value you have specified, or from the database. If you include a column in the result message that does not appear in the Columns list of the New Record Builder window, Tango must do a search of the database to retrieve the new record after it is added. To do so, Tango must have the value of the record's primary key column(s). This means the primary key column(s) must appear in the Columns list of the builder. Without this information, Tango Editor does not permit you to build the New Record actions. To enter Header HTML, Footer HTML, or New Record Response HTML |
![]() |
Changing Button TitlesThe new record entry form contains two buttons at the bottom of your form:
To change button titles |
![]() |
Actions Built by the New Record BuilderThe actions built by the New Record Builder appear in the application file window. For more information, see "Building the Actions". The following shows the actions resulting from the New Record Builder process and the conditions under which the actions are built: |
If no form is present, this is an If action named IfInsert.
|
|
HTML SnippetsThe Snippets Workspace contains a snippets folder named Builder Snippets, and a subfolder named New Record. The New Record folder contains snippets for the Form Header, Form Footer, and New Record Response. The New Record Builder uses these snippets in the designated places as default values for the named attributes. |
Copyright © 1998, Pervasive Software Inc. All rights reserved.